HOWTO sync your files with rsync
This HOWTO will expound to you basics of using the rsync tool.
Contents |
About rsync
Rsync is a tool for file sync with remote machine and to create backups.
Where to download?
Source code is available at http://rsync.samba.org/download.html. There are also packages for nearly all distros of GNU/Linux and *BSD.
Use
The project consists of server (sharing files - rsyncd) and sync client (rsync)
Server
To start rsync we'll need a config file (/etc/rsyncd.conf), it's bulit like .INI files. Example file:
uid = nobody gid = nobody [projects] path = /home/projects/public comment = Projects [ftp] path = /home/ftpd/pub comment = Public FTP
This file forces the rsync daemon to change user to nobody and share two dirs. More info about file building is THERE
Daemon should be started by inetd:
rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon
Client
Client is handled by console (there are also some GUIs), basic command look like this:
rsync rsync://serwer.pl/projects projekty
Some switches' description:
-a --archive - archive the files -b --backup - do a backup -c --checksum - use checksums to check integrity -v --verbose - debugging mode (-vv for more info) -r --relative - relative mode -u --update - don't download existing and unchanged files -l --links - copy links -h --human-readable - show data more human-friendly -p --progress - show progress -z --compress - compress incoming files -6 --ipv6 - use IPv6 -4 --ipv4 - use IPv4
More info when used with --help, in manual and on project page.