linux:rsync

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:rsync [2018/08/28 10:55] michaellinux:rsync [2020/03/26 10:43] (current) – [Rsync Examples] michael
Line 30: Line 30:
 </WRAP> </WRAP>
  
-----+
  
 ===== Rsync Examples ===== ===== Rsync Examples =====
  
 +''When specifying the Rsync data parameters, the following always applies: "**SOURCE**" "**DESTINATION**''
  
 +<WRAP center box 100%>
 +==== Basic Copy/Sync Files and Directory ====
  
-==== Copy/Sync Files and Directory Locally ==== +<wrap em>Attention</wrap>: the examples still have a "''--dry-run''" in them. If you want to copy data effectively and not only test the command, you have to remove this parameter
- +
- +
-=== Copy/Sync a File on a Local Computer === +
- +
- +
-=== Copy/Sync a Directory on Local Computer === +
  
 ---- ----
  
 +  * ''Copy/Sync Files and Directory locally'' <code>$ rsync -av /mnt/sourcefiles/webproject1/* /var/www/html/webproject1/ --delete --dry-run</code>
  
-==== Copy/Sync Files and Directory to or From a Server ====+  * ''Copy/Sync Files and Directory from a Server to local'' <code>$ rsync -av remote.serverdomain.com:/volume1/stuff/folder/ /mnt/localstorage/folder/other-folder/ --delete --dry-run</code> 
 +  * ''Copy/Sync Files and Directory from local to a Server'' <code>$ rsync -av remote.serverdomain.com:/volume1/stuff/folder/ /mnt/localstorage/folder/other-folder/ --delete --dry-run</code>
  
 +</WRAP>
  
-=== Copy a Directory from Local Server to a Remote Server === 
  
 +<WRAP center box 100%>
 +==== Using custom port for rsync over ssh ====
  
-=== Copy/Sync a Remote Directory to a Local Machine ===+To use another port with rsync, you can use the ''-e'' option to create an ssh tunnel and then using normal ssh parameter:
  
  
-----+<code>$ rsync --e "ssh -p 14022" /local/dir user@host:/backup/dir</code>
  
 +For example, if you want to force using IPv6 addresses, just add standard ''-6'' ssh parameter to above command:
  
 +<code>$ rsync -a -e "ssh -p 14022 -6" /local/dir user@host:/backup/dir</code>
  
 +You can also combine any other ssh parameters in this way.
  
 +See: [[man ssh|http://manpages.org/ssh]]
  
-FIXME +</WRAP>
- +
- +
- +
- +
- +
- +
-----+
  
-**Quelle:** 
-  * https://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ 
  
  
  • linux/rsync.1535446527.txt.gz
  • Last modified: 2018/08/28 10:55
  • by michael