Professional Documents
Culture Documents
Choose tool
Tool rsync
The following are examples demonstrating how to use rsync. For these
examples, root permissions are required for both the destination and source
servers. The example operations deal with common files such as
~/.ssh/id_rsa.pub and common folders such as /home/ and /.
-z is to enable compression
-v verbose
-r indicates recursive
Use the -a parameter with the rsync command to preserve time stamp
and permission information during a sync.
Recursive mode
Preserves symbolic links
Preserves permissions
Preserves timestamp
Preserves owner and group
Use rsync -e ssh to specify which remote shell to use. In this case, rsync
will use ssh with port 12345.
The rsync -u option ensures that the newer version of the file is not
overwritten, even if it is present at the destination.
To view the progress of the file backup, use the --progress option to view
information such as how many files are copied, the copying speed, etc.
If a file is not present at the source but is present at the target, delete the
file at the target location during the rsync.
Use the --existing option with the rsync command to specify that only
existing files at the target location are updated and files missing from the
target are not created.
Use the -i option to view the differences between the source and
destination versions of specific files or directories.
Use the rsync --max-size option to specify the maximum file size for
transfers.
BACK