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 [2010/08/01 04:04]
k2patel created
rsync [2020/08/10 02:35] (current)
Line 1: Line 1:
 ====== Rsync ====== ====== Rsync ======
 +
 +==== Commonly used switches for rsync ====
 +
 +with status and Common variable
 +<code bash>
 +rsync --verbose --progress --stats --compress --recursive --times --perms --links <​source>​ <​destination> ​ (location is defined as [hostname]::​path)
 +</​code>​
 +
 +==== SSH Wrapper ====
 +SSH Wrapper allows to transfer files using rsync over SSH.\\
 +Mostly usefull when dont have Rsyncd not running and have only access over ssh.
 +<code bash>
 +rsync -av -e "ssh -l testet"​ <​source>​ <​destination>​
 +</​code>​
 +
 +==== Limit Bandwidth / Disk I/O ====
 +
 +To limit bandwidth when transferring over Network.\\
 +OR\\
 +Limit Disk I/O when transferring between Disk.\\
 +Use "​--bwlimit"​ switch. it is measured as "​KBytes"​
 +
 +Following example limit 100 MB/s
 +<code bash>
 +rsync -avgop --progress --bwlimit=102400 /mnt/drive1 /mnt/driv2
 +</​code>​
  
 ==== General rsync Commands ==== ==== General rsync Commands ====
Line 15: Line 41:
         write only = true         write only = true
         list = false         list = false
 +</​code>​
 +
 +<code text | rsync.secret>​
 +rsyncusr:​password123
 +</​code>​
 +
 +
 +**NOTE :** 
 +  * Password is clear text password.
 +  * Make sure password file is not world readable else it will fail to authenticate.
 +
 +
 +Define script for rsync OR run it from command line.
 +
 +<code bash | rsync_test.sh>​
 +#!/bin/sh
 +
 +export RSYNC_PASSWORD=password123
 +/​usr/​local/​bin/​rsync -az --delete --exclude='​.*'​ /​srv/​www/​htdocs/​ rsync://​rsyncusr@rsync.host.com/​root/​
 +
 </​code>​ </​code>​
rsync.1280635456.txt.gz ยท Last modified: 2020/08/10 02:29 (external edit)