Using sudo

169 views
Skip to first unread message

joost baaij (space babies)

unread,
Jul 22, 2009, 4:50:29 PM7/22/09
to Whenever Gem
On my production systems, a separate user exists to run cronjobs. To
edit the crontab I need to sudo as this user, like so:

sudo -u USERNAME crontab -e

Is this possible with whevever?

Javan Makhmali

unread,
Jul 22, 2009, 4:56:37 PM7/22/09
to whenev...@googlegroups.com
You can use the --user option to specify which user's crontab to
write. You might change your cap task to:

sudo "cd #{release_path} && whenever --update-crontab #{application} --
user your_user"

joost baaij (space babies)

unread,
Jul 22, 2009, 5:25:43 PM7/22/09
to Whenever Gem
Thanks, that got me on the right track towards finding an answer.

whenever --user passes the value on to crontab -u. However for me that
is not allowed by the sysadmins. But when I wrap the entire whenever
command in a sudo -u that should work fine.
Reply all
Reply to author
Forward
0 new messages