Introduction to crontab - Sending the output
(Page 2 of 3 )
In some cases you need to be emailed the output for the program. in this case you would put:
*10/ * * * * <command> >/somedir/.output 2>&1 | /somedir/some_program_to_send_mail /somedir/.output | rm /somedir/.output |
Note that the preceeding should be entered on one line.
In other cases you don't want the output so you would put:
*10/ * * * * <command> >/dev/null 2>&1 |
Real usesA very nice real use is in FreeBSD you can update the ports database by putting this in the crontab:
* * *1/ * * cvsup -g -L 2 /root/ports-supfile >/dev/null 2>&1 |
Notice: To use this you must copy /usr/share/examples/cvsup/ports-supfile to /root/ports-supfile
Another one:
* * *1/ * * fetch http://yoursite.com/clearshoutbox >/dev/null 2>&1 |
Next: Thats all >>
More Server Administration Articles
More By Codewalkers