Showing results for 
Search instead for 
Did you mean: 

rsync question

Go to solution
Darren Etheridge_2
Super Advisor

rsync question

Why when I copy files from one server to another server using the cp command and it finishes, then someone runs rsync on the same filesystem/files to the same destination, do the files get re-copied again? I thought rsync compared the source/destination and only copied any new or updated files.


Patrick Wallek
Honored Contributor

Re: rsync question

It likely depends on how you are copying the files. If you just copy the files and the date/time stamps do not match, then that could be what is triggering the copy when you run rsync.

Rsync can also use cksum to see if files have been changed. If the cksum of the file is different then it will be copied again.
Bill Hassell
Honored Contributor

Re: rsync question

cp has an option -p that preserves the modification time and permissions. Without this option, the copied file is not the same as the original as it has a different timestamp. rsync makes sure that the two files are really the same including timestamp.

Bill Hassell, sysadmin
Honored Contributor

Re: rsync question

It`s good to use scp -p to transfer files ,or make a tar ball rather & transfer it over lan &
then do a restore.

However rsync is also a secure one at it uses ssh instead of remsh.

HP-UX been always lovable - Mani Kalra
Valued Contributor

Re: rsync question

You are right, rsync will copy the changed files only.

But, rsync is very slow process. I will recommend you to use fbackup/frecover which runs like rsync but you need a nfs mount.

Compare to rsync, fbackup/frecover is very fast; also, if there is a large lv has to be copied, then even the dd works good.