rsync
NetworkAdvanced In real LinuxSync files efficiently (only what changed)
Name: rsync = remote sync
This command needs a real Linux system; you can practise it in real Linux mode.
Description
rsync synchronises files locally or with remote hosts. Its strength is incremental transfer: only changed files, even only changed parts of files, are sent, so repeat syncs are fast. Used for backups, deployments and mirrors.
Mind the trailing slash: src/ syncs the directory's contents, src the directory itself.
Syntax
rsync [OPTION]... SOURCE DESTCommon options
| -a / --archive | Archive: recursive, keep permissions and times |
| -r / --recursive | Copy directories recursively (part of -a) |
| -v / --verbose | Verbose |
| -z / --compress | Compress during transfer |
| -h / --human-readable | Show sizes with K, M and so on |
| -P | Show progress and keep partly sent files (to resume) |
| --progress | Show progress for each file |
| -n / --dry-run | Dry run |
| --delete | Delete extra files on the destination |
| --exclude PATTERN | Skip files matching PATTERN, e.g. --exclude=".git" |
| --include PATTERN | With --exclude: send these anyway |
| -u / --update | Do not overwrite files that are newer on the destination |
| -c / --checksum | Decide by checksum rather than size and time (slower, more exact) |
| -e / --rsh COMMAND | The remote shell, e.g. -e "ssh -p 2222" |
| --bwlimit RATE | Limit the bandwidth, e.g. --bwlimit=1m |