/ rsync

Quickie: Rsync

Just a command to help you backup / archive your server.

sudo rsync -avhe 'ssh -i /home/user/.ssh/id_rsa -p 2222' \
--numeric-ids \
--progress \
admin@your.server.tld:/path/to/your/data/ \
/path/to/local/data/backup/

-a - archive, this is an alias to lots of other options
-v - verbose, so you see what's happenning
-h - human readable numbers
-e - remote shell
--progress - self explanatory
--numeric-ids - don't map UID/GID by user/group name
For more options refer to manual.

In this example we connect with local user SSH key, to non-standard SSH port 2222.

Keep in mind, if you want to keep permissions and ownership, you need to run this command as root. Otherwise owner will be your local user.

Tags:
#rsync #quickie #bash #backup #archive

TvK

IT and languages. Feel free to be a grammar-nazi and correct my English (or any other language).

Read More