Problems using rsync with cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problems using rsync with cron
# 1  
Old 12-14-2009
Problems using rsync with cron

Hi,

I've created a cron job for a script with a rsync command in it. The script is named pull.sh and contains the following line :

Quote:
rsync -avz 7-h2.my00001.cserver.mygrid.asia:/backups/daily/myob /backups/myob >> output.log
What it is supposed to do is pull backup files from the production server of my company to my local server. It should also generate the log file (output.log) to show the result.

The crontab settings is :

Quote:
45 18 * * * sh /sbin/pull.sh > /tmp/pulling.log
So by right with the settings above, I should get the backup files in my local servers /backups/myob directory. At the same time, I should also get the results in the output.log.

But the problem is I don't get the results at all.

I have SELinux running in permissive mode. Could this be the reason?

Previously the settings of SELinux was Disabled mode. At that time, executing rsync from the command line was also successful. But after changing the settings to permissive, I can't the results from the command line nor from cron.
# 2  
Old 12-15-2009
Test it by having absolute path for both output.log & sh.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Email Notifications on Cron Bash Error Only cp mv rsync

Wondering if anyone can point me to an example of how to setup a bash script that executes cp mv and rsync commands and only sends an email if there were errors with any of those commands and what the errors are. In addition it should email if the cron event to execute the script fails, or in... (1 Reply)
Discussion started by: consultant
1 Replies

2. Shell Programming and Scripting

Rsync script and backup problems.

Hello everybody I'm triing since few days to do this. So sorry if my question looks stupide, but i've tried. I have to get picture from a folder (who is updated automaticly and with subfolder) with theirs extensions (i'm ok on that) and this files have to me copied in a folder where a website... (7 Replies)
Discussion started by: boytruc
7 Replies

3. UNIX and Linux Applications

Rsync works in shell but not in cron

So I have this rsync script I wrote to grab some sql files and import them to a database. I left in the mysql stuff just give context to the situation. The real problem is with my rsync code. script.sh (chmod 744) #!/bin/sh rsync -av --rsh="sshpass -p'PASSWORD' ssh -l'USERNAME'"... (3 Replies)
Discussion started by: noPermissions
3 Replies

4. UNIX for Advanced & Expert Users

rsync not working thro' cron

Hi, I am able to use rsync and run it thro' command line. But when I schedule a script file that has rsync command thro' cron, the job doesn't get executed. All other jobs in the cron runs fine. cron entry-- 57 13 * * * /home/apm/cron/rsync-backup.sh rsync-backup.sh file-- rsync -avz... (1 Reply)
Discussion started by: sm23328
1 Replies

5. UNIX for Dummies Questions & Answers

rsync not working thro' cron -RH Linux

Hi, I am able to use rsync and run it thro' command line. But when I schedule a script file that has rsync command thro' cron, the job doesn't get executed. All other jobs in the cron runs fine. cron entry-- 57 13 * * * /home/apm/cron/rsync-backup.sh rsync-backup.sh file-- rsync -avz... (1 Reply)
Discussion started by: sm23328
1 Replies

6. Shell Programming and Scripting

Rsync script in cron from stepping on itself

I have the following rsync script that I use for syncing MySQL files from one server to another. I run the script at 20 minutes past every second hour in cron. I want to make sure that the script completes in it's entirety before it is set to kick off again. For example, when the script starts at... (3 Replies)
Discussion started by: sunsysadm2003
3 Replies

7. UNIX for Dummies Questions & Answers

Problems using rsync in Leopard with SSH... seeking solution/alternative

Precursor: ...it may sound like I'm at least somewhat comfortable with Unix, but I'm far from it. Layman's terms would be greatly appreciated :) Okay, so here's the situation. I created a website using iWeb, and I'm not using a .Mac account (you can sync website in one click if you do). Being... (4 Replies)
Discussion started by: compulsiveguile
4 Replies

8. UNIX for Advanced & Expert Users

Rsync via cron

Hi, I am running a rsync via cron job. Its running fine and is scheduled to 9:00 AM everyday. Sometimes it runs for more than 24 hours, such that the next days cron also fires. Now how will the sync happen as the <sync file> that both crons have created might conflict. Thanks (5 Replies)
Discussion started by: vibhor_agarwali
5 Replies

9. UNIX for Dummies Questions & Answers

use rsync by cron

Hi there: I run rsync very well by typing: rsync -avz /source /destination Then I want to run it by cron. So I had a crontab file like this: * * * * * rm file * * * * * rsync -avz /source /destination > cron_result (The first line is used to test whether cron is working.) When I check... (0 Replies)
Discussion started by: Steven.surfboy
0 Replies

10. UNIX for Dummies Questions & Answers

Rsync problems

Hi Im trying to syncronise 4 webserver mirrors, using the rsync command. /www/html is the html documents directory. i am using export RSYNC_RSH="/usr/local/bin/ssh -l $REMOTE_USER" rsyn -va /www/html remotehost:/www/html when this is run, it copies the html file over to the remote... (3 Replies)
Discussion started by: thangorn
3 Replies
Login or Register to Ask a Question