use rsync by cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers use rsync by cron
# 1  
Old 02-20-2006
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 the result, the first 'rm' command has been done but the 'rsync' doesn't work. cron_result is just empty.

Since the destination is on another machine, I use ssh for transportation. I set ssh-keygen to avoid asking password. Not sure whether this caused the problem.

I can't figure out the reason for this. Any help will be appreciated.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

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

3. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

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

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

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

9. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies

10. 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
Login or Register to Ask a Question
librsync(3)						     Library Functions Manual						       librsync(3)

NAME
librsync - library for delta compression of streams SYNOPSYS
#include <stdio.h> #include <stdlib.h> #include <librsync.h> cc ... -lrsync DESCRIPTION
The librsync library implements network delta-compression of streams and files. The algorithm is similar to that used in the rsync(1) and xdelta(2) programs, but specialized for transfer of arbitrary-length octet streams. Unlike most diff programs, librsync does not require access to both of the files on the same machine, but rather only a short ``signature'' of the old file and the complete contents of the new file. The canonical use of librsync is in the rproxy(8) reference implementation of the rsync proposed extension to HTTP. It may be useful to other programs which wish to do delta-compression in HTTP, or within their own protocol. There are HTTP-specific utility functions within librsync, but they need not be used. A number of tools such as rdiff(1) provide command-line and scriptable access to rsync functions. SEE ALSO
rdiff(1) rdiff and librsync Manual http://rproxy.sourceforge.net/. draft-pool-rsync BUGS
The rsync protocol is still evolving. There may be bugs in the implementation. The interface may change in the future, but it is becoming more stable. Many routines will panic in case of error rather than returning an error code to the caller. Patches to fix this are welcome, but at the current state of development aborting seems as useful as trusting to possibly-incomplete checking in the client. AUTHOR
Martin Pool <mbp@samba.org>, with Andrew Tridgell <tridge@samba.org>. rdiff development has been supported by Linuxcare, Inc and VA Linux Systems. Martin Pool $Date: 2003/06/12 06:03:32 $ librsync(3)