Sunday, December 24, 2006

Set up a Cron Job and Email the Results

Last week I setup a cron job to email a weekly status report to a group of logins. The group of logins was defined by an alias in the /etc/mail/aliases file. The crontab was modified to accomplish this task. Here's what I did.

# crontab -e (crontab editor)
45 06 * * 05 sort /home/esofthub/endofweeklystatus.dat | mailx -s "End of Week Status Report" aliasedgroup
:wq! (save results)

The minute is 45
The hour is 06
The day of the month is any (*)
The month of the year is any (*)
The day of the week (05) is Friday

No comments: