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 27th, 2005, 12:12 PM
chrs0302 chrs0302 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 43 chrs0302 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 30 sec
Reputation Power: 4
Mailing the crontab output

Hi all

We have a script which collects the uptime info of the servers. This info has to be mailed to one of the email addresses of our exchange server. An entry is made in the crontab as follows:

30 9,16 * * * /export/home/test11/upscript > mailx -s "Uptime Info" address@office.ca

We are able to send emails to the same account using mail/mailx utility from the server.

Thanks in advance

Reply With Quote
  #2  
Old January 28th, 2005, 01:46 AM
zlutovsky zlutovsky is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Prague, Czech Rep.
Posts: 116 zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 34 sec
Reputation Power: 6
Quote:
Originally Posted by chrs0302
Hi all

We have a script which collects the uptime info of the servers. This info has to be mailed to one of the email addresses of our exchange server. An entry is made in the crontab as follows:

30 9,16 * * * /export/home/test11/upscript > mailx -s "Uptime Info" address@office.ca

We are able to send emails to the same account using mail/mailx utility from the server.

Thanks in advance


Well, but what is your problem? Does it not work? If a cron job does not work exactly as a command line job, the problem is in its environment. I would call mailx using its absolute path and set the PATH variable the same way as it is when you run it from the command line. You can do it in a small script that encapsulates your cron commad and then you can call this new script from cron.

You can get some hint in the log your cron can have. Look at man cron, man crontab on your system.

Do you get some mail from your cron command? It is handy to store standard output and error output of the cron job into some files and there you can see some indication how to proceed.

Regards

Reply With Quote
  #3  
Old January 28th, 2005, 11:01 AM
chrs0302 chrs0302 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 43 chrs0302 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 30 sec
Reputation Power: 4
Crontab

Hi zlutovsky

Thanks for the response. I have made corrections in the syntax and it is set now.

Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Mailing the crontab output


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