On Wed, 19 Feb 2003, Tim Wunder wrote:
> The cron job belongs to my user, based on the fact that executing
> 'crontab -e' as my user lists the job, and the log file that's created
> is owned by me.
>
> I imagine I *could* run the job as root (heck, I could do *everything*
> as root, couldn't I?). If I run the job as root, then my source tree
> would become owned by root, so I'd either have to change ownership back
> to me when I want to manually update, or always update as root. Seems
> contrary to the genreally accepted practice of running as root as little
> as possible, though. And it doesn't address the question of why sudo
> doesn't seem to work when part of a cron job, but works swimmingly when
> run from the same script manually.

I think that's because cronjobs do not inherit the environment of the user
that they are running as.  So, all the env vars etc are not in play.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lonni J Friedman                                [EMAIL PROTECTED]
Linux Step-by-step & TyGeMo                  http://netllama.ipfox.com
_______________________________________________
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc -> http://www.linux-sxs.org/mailman/listinfo/linux-users

Reply via email to