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 09-28-2006, 10:29 AM   #1
crashsystems
Member
 
Registered: May 2006
Location: Tennessee et. al
Distribution: Debian Sid, Etch
Posts: 138

Rep: Reputation: 15
Cron conundrum


I'm currently trying to make a cron script to do an hourly backup of the files on my Ubuntu 6.06 file server using rsync. I've included below the code for /etc/cron.hourly/rsync
Code:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

rsync -ae ssh --delete-after backup@192.168.0.100:/mnt/drive1/Shared /mnt/backup > /home/admin/rsync.hourly.log
Also, thinking that the problem could be with file ownership stuff, I double checked that out, and it has an owner and group of root, and the permissions are -rwxrwxr-x. When I run the command manually in bash, it works just fine. So I went into /var/log/syslog, and found the following:
Quote:
Sep 28 08:17:01 localhost /USR/SBIN/CRON[31613]: (root) CMD ( run-parts --report /etc/cron.hourly)
Sep 28 08:17:01 localhost /USR/SBIN/CRON[31612]: (root) MAIL (mailed 152 bytes of output but got status 0x0001 )
My rsync script is the only script in /etc/cron.hourly, so I'm assuming that this entry from syslog is referring to my script. If anyone has an idea of why my cron script is not working, your help would be appreciated.


crashsystems

P.S.
I have configured passwordless logins for ssh, so that can't be the problem.

Last edited by crashsystems; 09-28-2006 at 11:44 AM.
 
Old 09-29-2006, 03:11 AM   #2
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
try to append '2>/dev/null' to your rsync command.
 
Old 09-29-2006, 09:53 AM   #3
crashsystems
Member
 
Registered: May 2006
Location: Tennessee et. al
Distribution: Debian Sid, Etch
Posts: 138

Original Poster
Rep: Reputation: 15
Well, I figured it out, though I'm not quite sure how. I decided to go look at some of the pre-configured cron.daily scripts to see if I could learn some from them. I decided to mimic their exact permissions for owner group and other. Once I did that, it worked perfectly, which is strange due to the fact that I had already made the script executable.

crashsystems
 
  


Reply

Tags
cron, resolved, rsync


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
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM
sendmail conundrum! siepmann Linux - Networking 1 07-02-2005 09:17 AM
A sed conundrum! Bert Linux - Software 2 12-09-2003 08:38 AM
@Home Conundrum. bzzt-whir Linux - Networking 0 02-18-2002 01:08 PM
Quite the conundrum...... Randall Linux - Newbie 10 11-09-2001 05:38 PM


All times are GMT -5. The time now is 09:25 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