[CentOS] weird cron problem
kerplop at sbcglobal.net
Fri Nov 16 13:26:27 UTC 2007
Andreas Kuntzagk wrote:
>> PATHS - everytime i have cron issues its a PATH problem. The cron env is
>> not the same as the user when logged in
> Thanks, that's probably the cause. rsnapshot resides in /usr/local/bin
> I changed the PATH in /etc/crontab now. Silly that I didn't see it.
> So jobs in /etc/crontab are executed with the PATH in there, but jobs in
> roots crontab are executed with the PATH set in .bashrc?
You can prove to yourself quite easily that $PATH gets manipulated.
Simply make a crontab entry like this in root's crontab:
* * * * * echo $PATH >> /root/cronpath
and compare the entries in the resulting file with the command line
# echo $PATH
(Don't forget to remove that crontab entry when finished playing.)
More information about the CentOS