I have not used cron before, so I cannot be sure that I did it correctly. The tasks I want to automate do not seem to work. I have done these steps in the terminal:
- sudo gem install when
- change application directory
- everytime. (this created the schedule.rb file)
I added this code to schedule.rb:
every 10.minutes do
runner "User.vote", environment => "development"
end
every :hour do
runner "Digest.rss", :environment => "development"
end
I added this code to deploy.rb:
after "deploy:symlink", "deploy:update_crontab"
namespace :deploy do
desc "Update the crontab file"
task :update_crontab, :roles => :db do
run "cd #{current_path} && whenever --update-crontab #{application}"
end
end
I did it in the terminal: whenever
He returned:
@hourly cd /Users/RedApple/S && script/runner -e development 'Digest.rss'
0,10,20,30,40,50 * * * * cd /Users/RedApple/S && script/runner -e development 'User.vote'
Executing these commands individually in the terminal works:
script/runner -e development 'Digest.rss'
script/runner -e development 'User.vote'
Now running the local server in script / server development mode, I see no evidence that this code is actually running. Is there any step that I have not taken? No manuals for "Whenever" show anything other than what I did.