LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-29-2008, 07:30 PM   #1
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Rep: Reputation: 31
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:
Code:
Authentication realm: <http://127.0.0.1:80> Jake's Subversion Repository
Password for 'root': Authentication realm: <http://127.0.0.1:80> Jake's Subversi
on Repository
Username: svn: PROPFIND request failed on '/svn'
svn: PROPFIND of '/svn': authorization failed (http://127.0.0.1)
Here's the script itself:
Code:
#!/bin/sh
SVNDIR=/rd0/svn-backup

cd $SVNDIR/Projects
svn update
cd $SVNDIR/Documents
svn update
cd $SVNDIR/QTP
svn update
cd $SVNDIR/JakesProgs
svn update
Now this runs perfectly if I just run it from the CLI (./svn-backup.sh). I've already chmod'ed it to +x.
Any ideas?
 
Old 04-29-2008, 07:34 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Try putting the full path for svn - cron doesn't inherit your environment (eg path)
 
Old 04-29-2008, 07:34 PM   #3
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,476

Rep: Reputation: 156Reputation: 156
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
 
Old 04-30-2008, 09:14 AM   #4
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Original Poster
Rep: Reputation: 31
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.
Thanks!
 
Old 04-30-2008, 10:34 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,003
Blog Entries: 54

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
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.
 
  


Reply

Tags
centos, cron, subversion


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd CD Light Behavior pdgardin Linux - General 1 08-06-2006 10:30 PM
Odd RedHat 9.0 behavior... 386 Linux - Networking 2 10-15-2004 10:00 AM
Odd Behavior of Epiphany Jeffmrg Slackware 2 09-09-2004 08:23 AM
getchar() 's odd behavior jenna_h Linux - Newbie 3 12-22-2002 12:29 PM
RH 6.2 ... odd behavior jubal Linux - Networking 3 02-27-2001 09:04 AM


All times are GMT -5. The time now is 04:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration