rsync not working thro' cron -RH Linux


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers rsync not working thro' cron -RH Linux
# 1  
Old 06-19-2008
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 --delete -e ssh2 /san/daily_exports/export/ test@sunny01:/san/daily_exports/export > /home/apm/cron/log
# 2  
Old 06-19-2008
whenever you see this:
Quote:
.. run it thro' command line. But when I schedule a script file that has rsync command thro' cron, the job doesn't get executed.
Check ENVIRONMENT variables, first off.

Where is rsynch? /usr/local/bin, maybe. cron on your box probably runs with PATH=/usr/bin. There maybe other env variables as well. Use env or printenv in the script to dump all of env variables.

cron entry--
57 13 * * * /home/apm/cron/rsync-backup.sh 2>&1 > /home/apm/cron/log


rsync-backup.sh file--
env
rsync -avz --delete -e ssh2 /san/daily_exports/export/ test@sunny01:/san/daily_exports/export

You can change this later on.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

2. 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

3. Shell Programming and Scripting

Linux - scripts not working in cron

hi all, i have scripts executable in manully, but not working in cron. any ideas? thanks a lot? * * * * * /home/dir/dir/file.sh #! /bin/sh alarmPath="/home/dir/monitoringAlarm" alarmDateTime="$(date +%Y%m%d) $(date +%H%M%S)" tomcatPID=`pidof /usr/local/jdk1.6.0_13/bin/java` echo "tomcat... (3 Replies)
Discussion started by: maxlee24
3 Replies

4. Red Hat

Linux - scripts not working in cron

hi all, i have scripts executable in manully, but not working in cron. any ideas? thanks a lot? * * * * * /home/dir/dir/file.sh #! /bin/sh alarmPath="/home/dir/monitoringAlarm" alarmDateTime="$(date +%Y%m%d) $(date +%H%M%S)" tomcatPID=`pidof /usr/local/jdk1.6.0_13/bin/java` echo "tomcat... (1 Reply)
Discussion started by: maxlee24
1 Replies

5. UNIX for Dummies Questions & Answers

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 : 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)... (1 Reply)
Discussion started by: anaigini45
1 Replies

6. 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

7. 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

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 not working :(

Hi all, I installed Rsync on my Solaris 8 but when I ran it, it returns ld.so.1: ./rsync: fatal: libpopt.so.0: open failed: No such file or directory Killed Please help. Thanks. (3 Replies)
Discussion started by: stancwong
3 Replies
Login or Register to Ask a Question