My Journal and Diary
2006
November
Thursday, November 2nd, 2006
AFU CRON Jobs Explained
Dennis Wicks contributed the following morsel of information to share with the AFU community. (AFU is my Auto FollowUp software, for automatically sending emails at regular intervals to clients and prospects).
The crontab entry for sending messages every 10 minutes is:
0,10,20,30,40,50 * * * * $HOME/bin/run_afu.sh >> $HOME/run_cgi.log
This logs the output from the cron job to $HOME/run_cgi.log so cron doesn't object about not knowing what to do with the generated output. Some systems send email to the owning user and some just refuse to run, so it is insurance of a sort, and reduces the size of your inbox.
The shell script $HOME/bin/run_afu.sh Actually does the work.
#!/bin/bash
cd $HOME/public_html/cgi-bin/afu
echo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo Starting at: `date`
run.cgi
echo
echo Finished at: `date`
This gives us some information about what is going on and when. It also tells me that on my system it takes less than a minute to send out 100 emails of typical size.Full path names are used throughout because cron doesn't provide a very useful environment so it is easier to just point it where you know things are at and save a lot of debugging time.
Thanks Dennis!
~Jason
Tags:webdesign perl_scripts autofollowup 0 likes ↑