UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old January 29th, 2004, 03:21 PM
csross csross is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 105 csross User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 56 m 28 sec
Reputation Power: 5
mail a log file

I want a cron job that mails a log file to a user.

My crontab entry says
43 15 * * 5 more /usr/logfile | mail user@company.com

It isn't mailing

Whats wrong?

Thanks

Reply With Quote
  #2  
Old January 30th, 2004, 12:33 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
You should use "cat", not "more".
Another problem could be the path of the mail command and/or permissions.
Which user's crontab is it? Can this user read the log file when logged in?
Does it work when you supply the full path to "mail"?

hth,
M.
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old January 31st, 2004, 12:03 PM
csross csross is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 105 csross User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 56 m 28 sec
Reputation Power: 5
I got the same results with cat or more.

What I did was mail user@com.com < file

Thanks

Reply With Quote
  #4  
Old February 4th, 2004, 08:23 AM
Ludootje Ludootje is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 49 Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 34 m 3 sec
Reputation Power: 9
are you sure your MTA is set up correctly?
__________________
Disclaimer: the owner of this post is NOT responsible for any moral and/or physical damage this post could cause to you.

Reply With Quote
  #5  
Old February 4th, 2004, 09:30 AM
csross csross is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 105 csross User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 56 m 28 sec
Reputation Power: 5
In that format, more file | mail user, I can do it at the command line. It just won't in the cron job. I did it the way I stated before. Is there a difference in doing it at the command line that in a cron job, as far as the way mail is set up?

Reply With Quote
  #6  
Old February 4th, 2004, 12:03 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Quote:
Originally posted by M.Hirsch
...the path of the mail command and/or permissions....

Reply With Quote
  #7  
Old February 4th, 2004, 01:02 PM
Ludootje Ludootje is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 49 Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level)Ludootje User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 34 m 3 sec
Reputation Power: 9
Yes Hirsch is right. Although the path probably isn't an issue (as your mta is probably in a standard path) it's possible that user 'cron' isn't allowed to execute it...
Check what groups 'cron' is part of.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > mail a log file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway