Running cron under sudo
Brian McKee
brian.mckee at gmail.com
Tue Oct 7 18:42:09 UTC 2008
On Tue, Oct 7, 2008 at 12:56 PM, Derek Broughton <news at pointerstop.ca> wrote:
> Brian McKee wrote:
>
>>>> Try sudo su - and then crontab -e
>>
>>> Thank you for taking the time to reply. I'm assuming you meant "sudo
>>> -i" as your first suggestion.
>>
>> Nope
>> sudo su -
>> will log you in as root after you provide YOUR password.
>
> No, he's right. The "proper" way to get a root user shell is "sudo -i".
I'm not sure about that. I've read both man pages, and I'm not sure
there's a difference. I think you end up in the same place so to
speak. Unless someone proves me wrong it's a habit I'm keeping :-)
>> Then crontab -e will work as expected.
> Not according to man crontab(1).
Yeah I know - I even quoted that section in my reply. After
re-reading it, you are probably right on this one. I always read that
as 'if you use su -c crontab -e' it might not work', but your
interpretation could very well be the correct one.
All that said - I tested it my way and it worked :-) So that's the
way I recommended it....
Brian
More information about the ubuntu-users
mailing list