I have an application that contains a bunch of tasks, and every day I want to run a cron job that creates a DayTask for each Task in the database. A Task has_many DayTasks a
Finally I have solved how to run the gem Whenever. It's working good on production, but not in development mode (I think that to working good in dev mode you must do some tricks).
Then, these are the processes to do:
scheduler.rb filessh)wheneverwhenever --update-crontab sudo service cron restartcrontab -lThat's it!
Personally, I prefer to set up my crons directly from the server:
crontab -e 0 5 * * * /bin/bash -l -c 'cd /path_to_my_app/current && RAILS_ENV=production bundle exec rake my_cron_rake' crontab -l