I was wondering if we can have an option to tell capistrano to set the crontab entry for another user.
I want to set a particular crontab entry to be run as apache user, but the deployment user is different and has sudo privileges.
Setting :user option did not set the crontab of apache user.
every 1.day do
rake "my_task", :user => "apache"
You can't do this per-task, but you can globally with the command: whenever --user apache
whenever --user apache
Thanks Javan. set :whenever_command, "sudo bundle exec whenever --user apache" worked.
set :whenever_command, "sudo bundle exec whenever --user apache"
Cool, you're welcome.