Rsync

From Indie IT Wiki

HOWTO

Install

sudo apt-get install rsync

Configure

sudo nano /etc/rsyncd.conf
max connections = 2
log file = /var/log/rsync.log
timeout = 300

[backups]
comment = Backups
path = /zfs/zpool1/backups
read only = no
list = yes
uid = root
gid = root

Start

sudo systemctl start rsync.service

Test

rsync localhost::

List Folders

rsync server::

Usage

rsync -nav /path/to/folder server::folder

INFO

Basic Syntax

rsync options source destination

Some common options:

  • a : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps
  • h : human-readable, output numbers in a human-readable format
  • r : copies data recursively (but don’t preserve timestamps and permission while transferring data)
  • v : verbose
  • z : compress file data

Use With Windows Files

Do not use the 'a' option when copying...

rsync -rltuv source destaination

Set Bandwidth Limit

Use the --bwlimit option. If you want to set a 5MB per second limit on file transfers...

rsync --bwlimit=5000 source destination

Thanks