Administration Système Réseau

Sauvegarder, synchroniser, accéder, restorer ses données avec rsync

Objectifs :

Sauvegarder, synchroniser, accéder, restorer ses données avec rsync

Comment :

rsync copies only the diffs of files that have actually changed, compressed and through ssh if you want to for security

Rsync transactions without SSH are insecure because the protocol and the software itself does not include any content encryption. So if there is a man in the middle he can read/copy what you are backing up. Authentication can be read also

In daemon mode, rsync listens on the default TCP port of 873, serving files in the native rsync protocol or via a remote shell such as RSH or SSH.[fusion_builder_container hundred_percent=”yes” overflow=”visible”][fusion_builder_row][fusion_builder_column type=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none”][5] In the latter case, the rsync client executable must be installed on the remote machine as well as on the local machine.

Bases :

rsync -options –otherOptions sourceDir targetDir


rsync [OPTION…] SRC… [DEST]

Access via rsync daemon:

rsync [OPTION…] [[email protected]]HOST::SRC… [DEST]

rsync [OPTION…] SRC… [[email protected]]HOST::DEST

Example 1 :

rsync -vaz ~/rep1/ ~/rep2

This example copies the contents of the ~/rep1 directory to the rep2 directory.
a : archive mode
>Recursive mode
>Preserves symbolic links
>Preserves permissions
>Preserves timestamp
>Preserves owner and group
v : verbose
z : zip files

Example 2 :

rsync -vaz ~/rep1 ~/rep2

This example creates a rep1 directory under the ~/rep2 directory and recursively copies the contents of the ~/rep1 into this new directory. This is slighly different from the first example.

Example 3 :

# rsync -av –progress –stats –delete –force hello.php [email protected]::instance/repository/
# rsync -av –progress –stats –delete –force hello.php [email protected]::instance/repository//testsync/

Links :[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]