Javan - whenever crontab with Capistrano deployment is not written

I try to get whenever you run an ec2 instance created using ec2 on rails.

When I deploy with Capistrano, this indicates that crontab was written, but when I log in to the server and run crontab -l, it does not seem to be changed.

If I went into the release folder and manually started --write-crontab every time, then run crontab -l - it will be updated properly.

Any ideas what could be causing this?

Capistrano does not indicate any errors, so I’m not sure how to debug it, I tried a billion permutations and combinations and nothing has changed.

+4
source share
3 answers
  namespace: deploy do
   desc "write the crontab file"
   task: write_crontab,: roles => [: db_admin] do  
     run "cd # {release_path} && sudo -u root whenever --write-crontab # {application}"
   end  
 end

Or, there seems to be the -user option when this might help.

0
source

you should simply require that whenever the capistrano command in your cover deployment file is the same:

required "whenever / capistrano"

If you are using bundler, you also need to add this:

set: when_command, 'bundle exec when

+1
source

This is not related to the OP, but according to this issue , Capistrano 2.11.1 needs when 0.7.3 to fix the problem.

0
source

Source: https://habr.com/ru/post/1286370/


All Articles