rsync: synchronize two websites and set local user

Today a simple one liner for synchronizing a remote website to another server. In my case I just wanted to get the file data from a production website to a local website using the according user and group of the local filesystem. Here is the one liner for this:

rsync -avz --chown=USER:GROUP remote_username@remote_host.tld:/path/to/directory/* .

This just does an rsync into the current directory and sets UID and GID for the transferred files.

Tagged with: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*