User Tools

Site Tools


rsync

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rsync [2021/01/12 14:35] – создано chifekrsync [2023/09/14 06:06] (current) – external edit 127.0.0.1
Line 13: Line 13:
  
 The newer versions of rsync are configured to use SSH as default remote shell so you can omit the -e ssh option. The newer versions of rsync are configured to use SSH as default remote shell so you can omit the -e ssh option.
 +
 +
 +or example, to transfer a single file /opt/file.zip from the local system to the /var/www/ directory on the remote system with IP 12.12.12.12 you would run:
 +
 +<code>rsync -a /opt/file.zip user@12.12.12.12:/var/www/</code>
 +
 +
 +The -a option stands for archive mode which will syncs directories recursively, transfer special and block devices, preserve symbolic links, modification times, group, ownership, and permissions.
 +
 +
 +===== Copying files using rsync from remote server to local machine =====
 +
 +From your local machine:
 +
 +
 +<code>
 +rsync -chavzP --stats user@remote.host:/path/to/copy /path/to/local/storage
 +</code>
 +
 +
 +From your local machine with a non standard ssh port:
 +
 +
 +<code>
 +rsync -chavzP -e "ssh -p $portNumber" user@remote.host:/path/to/copy /local/path
 +</code>
 +
 +
 +Or from the remote host, assuming you really want to work this way and your local machine is listening on SSH:
 +
 +
 +<code>
 +rsync -chavzP --stats /path/to/copy user@host.remoted.from:/path/to/local/storage
 +</code>
 +
 +
 +
  
rsync.1610462104.txt.gz · Last modified: 2023/09/14 06:06 (external edit)