Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I did an rsync from remote to local. Now I want to update the changed or newer files. How can I achieve it with rsync?

rsync -avz --progress -u -e ssh ServerName:FolderPath/FolderName LocalFolderName

It keeps downloading all files.

share|improve this question

Look at the switch --update. From man rsync:

-u, --update                skip files that are newer on the receiver

EDIT: -a implies -rlptgoD, I didn't take that into account. As I said in the comments: give us the command output. That will show if the files are actually transferred or just checked for changes and then ignored.

share|improve this answer
I have -u there or do I have to add it with -avzu? – creative Apr 5 '12 at 12:37
Are you sure that all files are transferred? Can you give us the command output with a test file? – Daniel Andersson Apr 5 '12 at 12:39
I got 5 GB of files..Thats a lot of files to download and provide you command output. If this is what you mean: xxxxxxx/yyyyyy.doc 74396 100% 86.18kB/s 0:00:00 (xfer#14, to-check=102041/102161) – creative Apr 5 '12 at 12:41
Make a smaller example to test with. A directory with two files will do fine. Experiment a bit. – Daniel Andersson Apr 5 '12 at 12:43
What are the source and destination file systems? – Paul Apr 5 '12 at 13:14

I go at this slightly differently, creating a TAR file of all the files that I want to back up on the host, then using rsync to pull that file to the backup controller.

rsync -e ssh -av --verbose --progress --log-file=rsync.log user@host:/home/user/backups/all_backup_files.tar /cygdrive/f/_host_backups >> F:\_host_backups\log.txt

Rsync only copies parts of the source file that have changed. Even though the TAR file may be very large, if only one small file is changed within that file, that's all the rsync transfers, and the backup process will take almost zero time.

share|improve this answer

All I do is

rsync -avz /local/path

I run this every night (but with remote and local swapped) to run an offsite backup, and all it transfers is the differences from a 20-odd gig backup directory.

I also put '--delete' in mine to remove files from the remote that I've removed from the local, but I took that out my example here to avoid confusion (and data loss from people who copy-and-paste before reading)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .