Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

3 Answers

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
2  
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
add comment

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
add comment

All I do is

rsync -avz user@remote.com:/remote/path /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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.