I am trying to set up CRON jobs on Amazon EC2 with using the Whenever gem.
In the schedule.rb
is following:
set :output, "/home/my_deploy_name/my_deploy_name/current/log/cron_log.log"
every 2.minutes do
puts "It's working !!!"
end
and in the deploy.rb
this:
...
set :whenever_command, "bundle exec whenever"
require "whenever/capistrano"
after 'deploy:create_symlink', 'whenever:update_crontab'
after 'deploy:rollback', 'whenever:update_crontab'
When I deploy this code to EC2 and check crontab -l
, the output is:
no crontab for ubuntu
When I run crontab -e
, the file is not edited.
What is wrong here? What the CRON job doesn't run on EC2 every 2 minutes?