I've written a perl script I can call from the command line which will create a vhost using a specified domain name, set up the database, and download Drupal (and modules) from CVS onto our server. I'd like to know if there's any way I can create the cron job for Drupal from that script as well. Entering them manually is a pain in the ass. I'm basically trying to streamline the entire setup process as much as possible. Any help would be greatly appreciated.


John Morahan’s picture

I don't know perl, but crontab -l dumps the current crontab to stdout, and crontab - reads a new one from stdin, so maybe you could use that.

From the shell you could do something like this:
(crontab -l ; echo "0 * * * * wget -O - -q http://www.example.com/cron.php") | crontab -