Reputation: 4415
I have set up a cron job, using the great whenever gem.
every 1.minute do
runner "PeerReview.start_feedbacks"
end
I set up the cron job with:
whenever --set environment=development --update-crontab
The crontab file looks fine, it shows:
* * * * * /bin/bash -l -c 'cd /path_to_app/ && script/rails runner -e development '\''PeerReview.start_feedbacks'\'' >> log/cron_log.log 2>&1'
If I execute the runner, it works fine, however, the cron job doesn^t seem to work (also I don't see a log being created).
What am I missing?
(I'm working on Mac OS X, 10.6.6)
update
I think I identified the problem: The path name contains spaces, and this wasn't handled correctly by the whenever gem, the crontab was filled incorrectly (the needed backslashes are missing), so the cronjobs are executed, but the path for the command is wrong.
Upvotes: 1
Views: 2273
Reputation: 4415
All above was correctly done.
The rails app was in a directory with spaces in the path names, those spaces were not escaped by the whenever gem, when setting up the crontab.
Upvotes: 0