Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating crontab via Capistrano instead of using crontab -e

I would like to include cron tasks in my Capistrano deployment files instead of using the following command to manually edit the crontab file:

crontab -e [username]

Is there a script I could use within the Capistrano run command to set the contents of the crontab?

like image 773
tdewell Avatar asked Oct 21 '09 22:10

tdewell


1 Answers

Check out the Whenever gem -- this may be stretching beyond what you're intending to do, but it uses very simple (Ruby) syntax and makes it dead simple to setup cron jobs within a capistrano deployment script.

like image 92
bensie Avatar answered Sep 21 '22 10:09

bensie