views:

27

answers:

0

I have not used cron before, so I can't be sure that I did this right. The tasks I want to be automated don't seem to be running. I did these steps in the terminal:

  1. sudo gem install whenever
  2. change to the application directory
  3. wheneverize . (this created the file schedule.rb)
  4. 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
    
  5. 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
    
  6. I did this in the terminal: whenever

  7. It 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'
    
  8. Running these commands individually in the terminal works:

    script/runner -e development 'Digest.rss'
    script/runner -e development 'User.vote'
    
  9. Now running a local server in development mode, script/server, I don't see any evidence that the code is actually being run. Is there some step that I didn't do? No guides for "Whenever" show anything else than what I have done.