[Tfug] cron jobs not running as root

Choprboy choprboy at dakotacom.net
Wed Jul 28 08:57:37 MST 2004


On Wednesday 28 July 2004 08:56, elemint at theriver.com wrote:
> I have created a cron job and while logged in as root the scipt runs 
> fine but if I configure crontab like contab -u root -e the job does not 
> run.
> I do see the job start in /var/log/syslog
> 
> The way that I know the job does not work sucessfully is becuase part of 
> the job is to send out an email and that is not working unless running 
> it at the command prompt as root.
> 

Check your script for full paths and/or setting environment variables... In 
mine I have to explicitly declare the full path/bin to run programs as there 
is no environment setup when the cron job runs (i.e. bashrc, bash_profile, 
etc. are not processed when a cron job runs). 

Adrian


More information about the tfug mailing list