Running cron under sudo

Derek Broughton news at pointerstop.ca
Tue Oct 7 16:47:05 UTC 2008


Anthony M. Rasat wrote:

>>I'm entering sudo's cron with >"sudo crontab -e"
> 
> If you tried to run crontab under root privilege, try this:
> 
> sudo su
> crontab -e
 
You shouldn't.  As man crontab(1) says:

"If the -u option is given, it specifies the name of the user whose crontab
is to be tweaked. If this option is not given, crontab examines "your"
crontab, i.e., the crontab of the person executing the command. Note that
su(8) can confuse crontab and that if you are running inside of su(8) you
should always use the -u option for safety's sake. "

-- 
derek





More information about the ubuntu-users mailing list