LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rsync with scp behavior (https://www.linuxquestions.org/questions/linux-newbie-8/rsync-with-scp-behavior-891280/)

jjj0923 07-12-2011 07:46 AM

rsync with scp behavior
 
I'm running :

rsync -r -v -e ssh root@nn.nn.nn.nn:/usr/local/websites/* /usr/local/websites

and each time I run it it copies everything - all files. I thought rsync was only supposed to copy files that had been added or modified.

thanks in advance for any help.

b0uncer 07-12-2011 07:49 AM

Did you try with -u option (update)? From the man page,
Quote:

-u, --update
This forces rsync to skip any files which exist on the destina-
tion and have a modified time that is newer than the source
file. (If an existing destination file has a modify time equal
to the source file's, it will be updated if the sizes are dif-
ferent.)
Another one which you might be interested in is the --ignore-existing, if you're not into updating at all.

Guttorm 07-12-2011 07:54 AM

The --ignore-existing doesn't update changed files. Without the -t option, rsync will compare all the files, which can be as slow as copying them. Just add the -a option, which is the same as -rlptgoD.

jjj0923 07-12-2011 08:22 AM

Quote:

Originally Posted by Guttorm (Post 4412601)
The --ignore-existing doesn't update changed files. Without the -t option, rsync will compare all the files, which can be as slow as copying them. Just add the -a option, which is the same as -rlptgoD.


cool - that worked - thanks you - kudos given.


All times are GMT -5. The time now is 05:26 PM.