Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By seanr on
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.
Comments
I don't know perl, but
I don't know perl, but
crontab -l
dumps the current crontab to stdout, andcrontab -
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 -