On Sun, 7 Sep 2003, Jason Lieurance wrote:
> Thank you for the response. Does the date part (Date=`date +"%Y-%m-%d"`)
> go as part of the cron job? Thanks again.

Well, you could cram all this into a crontab line, but you'll probably
want to use the cron entry to run a script containing these commands.
This way, you can make the script more elaborate, do error-checking, have
possible alternate responses mailed, things like that.
For what you want to do, the script could be very simple:

 #!/bin/sh
 # send_http_log.sh : mails httpd logfile.
 Date=`date +"%Y-%m-%d`
 cat /var/log/http/${Date}-error_log | mail -s log [EMAIL PROTECTED]
 exit

and then in the crontab have a line referring to the script:

0 1 * * *     /usr/local/bin/send_http_log.sh

or, alternately, add the script into the /etc/periodic/* directories to
have it run by the system-wide cron.

--
David Fleck
[EMAIL PROTECTED]

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to