Jump to Navigation

026 - rsync command for backup

The rsync command copies a set of files. It can make an exact copy, including file permissions and other
attributes (called mirroring), or it can just copy the data. It can run over a network or on a single machine.
rsync has many uses and over 50 options;
To mirror the directory D1 and its contents into another directory D2 on a single machine:

rsync [option] source dest

$ rsync -a D1 D2

In order to mirror directory D1 over the network to another host, server.example.com, where you have
an account with username smith, securing the connection with SSH to prevent eavesdropping:

$ rsync -a -e ssh D1 simith@server.example.com:   (-e : command )

Example :

$ rsync --progress -avhe ssh /var/www/vhosts/server1.example.com/data/backups/

$ rsync --bwlimit=250 --progress --delete -avz /d01/bkups root@remote_server:/d02/bkups


Main menu 2

Story | by Dr. Radut