Linux Cron Job or any job scheduler of Rails. Which is better for automated deployment?
I would like to know which of the options is better and why?
* Linux Cron Job * Background job scheduler of rails. (What plugin helps me in this is yet another question!)Some of the cron jobs that our application employs are as below:
-> 1 job to clean temp directory in the app server, every week -> 4 jobs to sync data to and from, between interdependent applicationsSome of the sync jobs take indeterminate time depending on the data load - some times it takes a minute, some times two minutes, some other times 5 minutes, etc
FYI - All the above jobs开发者_开发问答 are existing at present as Cron jobs.
With the above constraints, what is the best approach to run the background jobs, when we intend to have automated deployment?
If you intend to use capistrano for your deployment, I'd recommend the whenever gem : https://github.com/javan/whenever
Not only does it have a clean syntax for defining cron jobs, but it integrates well with the capistrano recipes
精彩评论