-   Linux - General (
-   -   Odd cron behavior with CentOS5 (

jakev383 04-29-2008 07:30 PM

Odd cron behavior with CentOS5
I recently installed CentOS5 on my home file server and also use this machine to "backup" my subversion repos. I created a script to go into each dir and update the repo. This script runs fine when I'm at the CLI. I move the script to /etc/cron.hourly and I get problems:

Authentication realm: <> Jake's Subversion Repository
Password for 'root': Authentication realm: <> Jake's Subversi
on Repository
Username: svn: PROPFIND request failed on '/svn'
svn: PROPFIND of '/svn': authorization failed (

Here's the script itself:


cd $SVNDIR/Projects
svn update
cd $SVNDIR/Documents
svn update
svn update
cd $SVNDIR/JakesProgs
svn update

Now this runs perfectly if I just run it from the CLI (./ I've already chmod'ed it to +x.
Any ideas?

billymayday 04-29-2008 07:34 PM

Try putting the full path for svn - cron doesn't inherit your environment (eg path)

jailbait 04-29-2008 07:34 PM

Try giving the full path for the svn command. Or you could set the PATH in the cron job to be the same as the PATH that you have at your CLI.

Steve Stites

jakev383 04-30-2008 09:14 AM

That didn't work either. I ended up putting the script in /usr/local/sbin (irrelevant really) and then adding the cron to root's crontab (crontab -e). That pulled my ENV variables with it so all seems well now.

unSpawn 04-30-2008 10:34 AM

When you run the command or script from the commandline you run it as root account user, and crond runs as another user. If one doesn't want to use the root account crontab then Sudo should work.

All times are GMT -5. The time now is 05:56 AM.