The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > BSD
.
google unix.com



BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to use tee with stdout and stderr? siegfried Shell Programming and Scripting 3 01-14-2009 10:07 PM
can't install AWStats jasonfrost BSD 3 08-18-2008 04:29 PM
csh stderr redirection jolok Shell Programming and Scripting 0 04-15-2005 10:03 AM
stderr redirection blakmk UNIX for Dummies Questions & Answers 5 12-12-2002 01:22 PM
stderr dell9 High Level Programming 1 11-21-2001 06:49 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-19-2008
flashm3 flashm3 is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 2
Awstats stderr solution

Hello!

Firts of all, sorry fo my poor english, but i hope you'll undestand me

Ok, let's go to the problem....

I have a lot of awstats crontabs, and i have one mail,where i get daily and weekly output of all servers that i administrate, now it's problem that i get to his mail every time, when crontab for awstats is started.

I was searching on google so long, but i did't find any fine solution too me, because i don't want to use this in the end of crontab -> CRON >/dev/null 2>&1
because this will email me only if file won't exist anymore.

Finally, i want that crontab for awstats send me email just in case if awstats don't update correcly.

Thank you very much!

Regards
  #2 (permalink)  
Old 08-21-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
So is there a program or script named "awstats" which is in a crontab? Let's say you have this job running every day at 2:30 am.

Code:
2  30  * * * /usr/local/bin/awstats
If you want it to only email you when there's a problem, just do this:
Code:
2  30  * * * /usr/local/bin/awstats >/dev/null 2>&1 || echo "awstats failed to complete"
This does require that the script exit with a non-zero condition upon an error. Do you have a way of testing this?
  #3 (permalink)  
Old 08-21-2008
flashm3 flashm3 is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 2
Hmmm.... maybe this'll work, buti don't know if this will alert me, if config file doesn't exit and if update wasn't successfully made?
  #4 (permalink)  
Old 08-22-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
Test it. Run awstats and force an error condition (one way is to kill the process from another terminal). Then in the command prompt after awstats returns, run
Code:
echo $?
If it exited with a non-zero, cron will email you. Make sure cron CAN email you.
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0