rsync + ssh and scp

Something I could have misunderstood for a long time.  I always think scp is powerful for retrieving files by a local host from a remote server but all the files obtained will have permissions and access rights set to the one who invoke the scp command.

#scp -P 1234 -R user@xyz.com:/remote/path/ /local/path/

This is not desirable for restoration purpose  as the original attributes have been lost.  I turn to use rsync like the one below:

#rsync -chavzP --stats --rsh='ssh -p1234' user@xyz.com:/remote/path/ /local/path/

As I have always said, rsync is one of the most powerful backup tools ever existed in the world.  The more you learn, the more you love it.

No comments: