rsync(1) User Commands rsync(1) (NAME) rsync - (SYNOPSIS) Local: rsync [OPTION...] SRC... [DEST] Access via remote shell: Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST] Push: rsync [OPTION...] SRC... [USER@]HOST:DEST Access via rsync daemon: Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST] Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST SRC DEST . ( ) : . (DESCRIPTION) Rsync . / / rsync . . Rsync (delta-transfer) . Rsync . Rsync ( ) << >> . ( ) . rsync : o o exclude exclude-from GNU tar o CVS CVS o ssh rsh o (super-user) o o rsync ( ) (GENERAL) rsync . . rsync : ( ssh rsh) rsync TCP. (:) . rsync rsync . rsync . (user ID) rsync . rsync (::) rsync:// . rsync . rsync USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION . "ls -l" . ( --list-only ). rsync . rsync . . rsync . (SETUP) rsync . rsync README.md . rsync rsync . rsync ssh . -e RSYNC_RSH . rsync . (USAGE) rsync cp rcp . . : rsync -t *.c foo:src/ *.c src foo . rsync . (*.c) rsync rsync ( Posix). rsync -avz foo:src/bar /data/tmp src/bar foo /data/tmp/bar . . . rsync -avz foo:src/bar/ /data/tmp . / << >> << >> . /dest/foo: rsync -av /src/foo /dest rsync -av /src/foo/ /dest/foo . "/dest" : rsync -av host: /dest rsync -av host::module /dest rsync ':' . copy . ( ) rsync : rsync somehost.mydomain.com:: (COPYING TO A DIFFERENT NAME) : rsync -ai foo/ bar/ rsync . : o ( ) o o rsync ( ). . foo.c bar.c save ( bar.c ): rsync -ai src/foo.c save/bar.c (wildcard) . src/*.c save/dir save/dir : rsync -ai src/*.c save/dir : rsync -ai src/*.c save/dir/ (SORTED TRANSFER ORDER) rsync . . . rsync . --delay-updates . (SECURITY) rsync . SECURITY.md . host:path ( ssh) -- . (host::module rsync://) . ssh ( USING RSYNC- DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION ) TLS rsync-ssl(1) RSYNC_SSL_CA_CERT . --password-file ( ) . rsync rsync rsync . rsync . (exclude) . . : rsync -aiv host1:dir1 ~ "host1-files" : rsync -aiv host1:dir1 ~/host1-files --trust-sender . . --no-links (munging) --munge-links ( ). ( ) --files-from . (SYMBOLIC LINKS) ( /etc/passwd). --safe-links --munge-links --no-links . (SYMBOLIC LINKS) . -- --backup-dir --temp-dir --partial-dir --link-dest/--compare-dest/--copy-dest --log-file --files-from/--include-from/--exclude-from --filter --write-batch/--read-batch -- root . --insecure-links ( ) . rsync rsync . --checksum-choice (--cc --cc=sha1 xxHash) RSYNC_CHECKSUM_LIST MD4/MD5 . << >> rsync ( --checksum-choice=none ). --protocol . rsync ( MD4 -- AUTHENTICATION STRENGTH rsyncd.conf(5) ). (ADVANCED USAGE) . : rsync -aiv host:file1 :file2 host:file{3,4} /dest/ rsync -aiv host::modname/file{1,2} host::modname/extra /dest/ rsync -aiv host::modname/first ::extra-file{1,2} /dest/ modname ( extra-file1 extra-file2 ). rsync ( 3.0.0 ) . . rsync ( 3.2.4) . rsync : rsync -aiv host:'a simple file.pdf' /dest/ (quoting) rsync rsync (escaping) . --old-args rsync ( rsync ) RSYNC_OLD_ARGS=1 RSYNC_PROTECT_ARGS=0 ( rsync ) . RSYNC (CONNECTING TO AN RSYNC DAEMON) rsync . <<>> (module) . rsync rsyncd.conf(5) . rsync TCP 873 . rsync << RSYNC >> . rsync rsync : o ( ) (::) rsync:// . o <<>> . o / << (ADVANCED USAGE)>> . o << >> (message of the day) . o ( ) . o . o rsync --rsh (-e) . rsync rsync . << RSYNC >> . "src" : rsync -av host::src /dest . . RSYNC_PASSWORD --password-file . rsync . : . --password-file . RSYNC_PROXY hostname:port . 873 . RSYNC_CONNECT_PROG . "%H" rsync ( "%" "%%" ). : export RSYNC_CONNECT_PROG='ssh proxyhost nc %H 873' rsync -av targethost1::module/src/ /dest/ rsync -av rsync://targethost2/module/src/ /dest/ ssh nc (netcat) proxyhost 873 ( rsync) targethost (%H) . RSYNC_SHELL RSYNC_CONNECT_PROG system() . RSYNC (USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION) rsync ( ) . rsync <<>> . . (root) chroot (user ID) . ( ssh rsync "localhost" .) rsync --rsh=COMMAND . ( RSYNC_RSH .) : rsync -av --rsh=ssh host::module /dest "user@" : rsync-user ( ) . rsync -av --rsh=ssh user@host::module /dest ssh -l user host "user" rsync-user . (ssh) rsync-user '-l' ssh . ssh rsync '-l' "user@" rsync-user . --rsh: rsync -av -e "ssh -l ssh-user" rsync-user@host::module /dest "ssh-user" ssh "rsync-user" "module" . ssh ( ~/.ssh/authorized_keys ). . RSYNC (STARTING AN RSYNC DAEMON TO ACCEPT CONNECTIONS) rsync ( inetd rsync ). rsyncd.conf(5) . (stand-alone) inetd . rsync . (EXAMPLES) rsync . MS Word cron : rsync -aiz . bkhost:backup/joe/ : rsync -aiv --remove-source-files rhost:/tmp/{file1,file2}.c ~/src/ (OPTION SUMMARY) rsync . . --verbose, -v (verbosity) --info=FLAGS --debug=FLAGS --stderr=e|a|c stderr (: errors) --quiet, -q --no-motd MOTD --checksum, -c --archive, -a -rlptgoD ( -A,-X,-U,-N,-H) --no-OPTION OPTION ( --no-D) --recursive, -r --inc-recursive, --i-r --no-inc-recursive --no-i-r --no-inc-recursive --relative, -R --no-implied-dirs --relative --backup, -b ( --suffix --backup-dir ) --backup-dir=DIR DIR --suffix=SUFFIX ( ~ --backup-dir) --update, -u --inplace --append --append-verify --append --dirs, -d --old-dirs --dirs rsync --old-d --old-dirs --mkpath --links, -l --copy-links, -L / --copy-unsafe-links <<>> --safe-links --insecure-links --confine-root=DIR DIR --munge-links --copy-dirlinks, -k --keep-dirlinks, -K --hard-links, -H --perms, -p --executability, -E --chmod=CHMOD / --acls, -A ACL ( --perms) --xattrs, -X --owner, -o ( ) --group, -g --devices ( ) --copy-devices --write-devices ( --inplace) --specials --drop-D / -D --devices --specials --times, -t --atimes, -U () --open-noatime atime --crtimes, -N () --omit-dir-times, -O --times --omit-link-times, -J --times --super --fake-super / xattrs --sparse, -S (sparse) --preallocate --dry-run, -n --whole-file, -W ( ) --no-whole-file, --no-W --checksum-choice=STR ( --cc) --one-file-system, -x --block-size=SIZE, -B --rsh=COMMAND, -e --rsync-path=PROGRAM rsync --existing --ignore-non-existing --ignore-existing --remove-source-files ( ) --del --delete-during --delete --delete-before --delete-during --delete-delay --delete-after --delete-excluded --ignore-missing-args --delete-missing-args --ignore-errors I/O --force --max-delete=NUM NUM --max-size=SIZE SIZE --min-size=SIZE SIZE --max-alloc=SIZE --partial --partial-dir=DIR DIR --delay-updates --prune-empty-dirs, -m --numeric-ids uid/gid / --usermap=STRING --groupmap=STRING --chown=USER:GROUP / --timeout=SECONDS I/O --contimeout=SECONDS --ignore-times, -I --size-only --modify-window=NUM, -@ --temp-dir=DIR, -T DIR --fuzzy, -y --compare-dest=DIR DIR --copy-dest=DIR ... --link-dest=DIR DIR --compress, -z --compress-choice=STR ( --zc) --compress-level=NUM ( --zl) --compress-threads=NUM ( --zt) --skip-compress=LIST LIST --cvs-exclude, -C CVS --filter=RULE, -f RULE -F --filter='dir-merge /.rsync-filter' : --filter='- .rsync-filter' --exclude=PATTERN PATTERN --exclude-from=FILE FILE --include=PATTERN PATTERN --include-from=FILE FILE --files-from=FILE FILE --from0, -0 *-from/filter 0 --old-args --secluded-args, -s --trust-sender --copy-as=USER[:GROUP] --address=ADDRESS (bind) --port=PORT --sockopts=OPTIONS TCP --blocking-io I/O --outbuf=N|L|B None Line Block --stats --8-bit-output, -8 --human-readable, -h --progress -P --partial --progress --itemize-changes, -i --remote-option=OPT, -M OPTION --out-format=FORMAT FORMAT --log-file=FILE FILE --log-file-format=FMT FMT --password-file=FILE FILE --early-input=FILE FILE --list-only --bwlimit=RATE I/O --stop-after=MINS rsync MINS --stop-at=y-m-dTh:m rsync --fsync fsync --write-batch=FILE FILE --only-write-batch=FILE --write-batch --read-batch=FILE FILE --protocol=NUM --iconv=CONVERT_SPEC (charset) --checksum-seed=NUM / () --ipv4, -4 IPv4 --ipv6, -6 IPv6 --version, -V + --help, -h (*) (* -h ) rsync (daemon) : --daemon run as an rsync daemon --address=ADDRESS bind to the specified address --bwlimit=RATE limit socket I/O bandwidth --config=FILE specify alternate rsyncd.conf file --dparam=OVERRIDE, -M override global daemon config parameter --no-detach do not detach from the parent --port=PORT listen on alternate port number --log-file=FILE override the "log file" setting --log-file-format=FMT override the "log format" setting --sockopts=OPTIONS specify custom TCP options --verbose, -v increase verbosity --ipv4, -4 prefer IPv4 --ipv6, -6 prefer IPv6 --help, -h show this help (when used with --daemon) (OPTIONS) rsync ( + ) ( + ) . . . . . --option=param --option param -o=param -o param -oparam ( ). (shell) . (~) ( ) . --help rsync . -h --help ( --human-readable ). --version, -V rsync . JSON ( ). checksum rsync . --verbose, -v . rsync . -v . -v . -v (debug) rsync . rsync ( ) rsync . ( ) rsync . <> ( ). --human-readable ( --no-human-readable) ( ) . -v --info --debug . --verbose (fine-grained) -v . --info --debug (verbosity) ( --info=help --debug=help ). <> . info / debug -vv -vv . --info=FLAGS . 0 1 ( ). --info=help . : rsync -a --info=progress2 src/ dest/ rsync -avv --info=stats2,misc1,flist0 src/ dest/ --info=name --out-format --itemize-changes (-i) . . 3.1.0 ( 2013) rsync . <> . --debug=FLAGS (debug) . 0 1 ( ). --debug=help . : rsync -avvv --debug=none src/ dest/ rsync -avA --del --debug=del2,acl src/ dest/ --stderr=all I/O . . rsync . (brace expansion) . zsh bash : rsync -aiv {-M,}--debug=del2 src/ dest/ --stderr=errors|all|client stderr stdout stderr . . : o errors - () rsync stderr . . stderr ( ) . o all - rsync ( ) () stderr . stderr ( ) . ( ). --debug I/O . o client - rsync . stderr stdout. rsync . rsync --stderr=all . rsync --msgs2stderr --no-msgs2stderr all client rsync . --quiet, -q . rsync cron . --no-motd . (MOTD) "rsync host::" ( rsync) . --ignore-times, -I rsync . << >> . --ignore-existing --ignore-non-existing rsync rsync . --size-only << >> rsync . rsync . --modify-window=NUM, -@ modify-window rsync . 0 . ( 3.1.3 2018 ) . 1 / FAT FAT 2 ( 1 ). ~/.popt : rsync alias -a -a@-1 rsync alias -t -t@-1 --modify-window=0 ( -@0) ext3 ext4 rsync 3.1.3 . --checksum, -c rsync . rsync << >> ( ) . (checksum) . I/O ( ). . : . rsync << >> . --checksum-choice (--cc) . --archive, -a -rlptgoD . . ACL (-A) xattrs (-X) atimes (-U) crtimes (-N) (-H) . --files-from -r . --no-OPTION "-no" . ( --no-D --no-perms) ( --no-whole-file --no-blocking-io --no-dirs). "-no" ( --no-R --no-relative ). --archive (-a) --owner (-o) -a -rlptgD -a --no-o ( --archive --no-owner) . : --no-r -a -r -a --no-r . --files-from -a ( --files-from ). --recursive, -r rsync . --dirs (-d) . --inc-recursive . --inc-recursive, --i-r --recursive rsync 3.0.0 ( ) . ( ). . rsync . : o --delete-before ( --delete) o --delete-after o --prune-empty-dirs o --delay-updates --delete-during --delete . ( ) . ( ) rsync ( ). mode mtime -- . --omit-dir-times . --no-inc-recursive (--no-i-r) . --no-inc-recursive, --no-i-r --recursive . rsync . --inc-recursive . --relative, -R . . . : rsync -av /foo/bar/baz.c remote:/tmp/ baz.c /tmp/ . : rsync -avR /foo/bar/baz.c remote:/tmp/ /tmp/foo/bar/baz.c . " " ( "foo" "foo/bar" ). rsync (symlink) . . . rsync --no-implied-dirs . . rsync ( 2.6.7 ) : rsync -avR /foo/./bar/baz.c remote:/tmp/ /tmp/bar/baz.c . ( <> .) rsync . : (cd /foo; rsync -avR bar/baz.c remote:/tmp/) ( <> .) rsync ( ): rsync -avR --rsync-path="cd /foo; rsync" \ remote:bar/baz.c /tmp/ --no-implied-dirs --relative . . . . files-from rsync <> <> <> --relative . <> <> rsync <> . --no-implied-dirs rsync <> <> . : --no-implied-dirs . ( .) --keep-dirlinks ( ). rsync 3.0.0 ( ) . --backup, -b ( ). --backup-dir --suffix ( ) . --backup-dir : 1. --omit-dir-times 2. --delete ( --delete-excluded) rsync "protect" : -f "P *~". . exclude/protect ( / * ). --backup-dir=DIR --backup rsync . . --suffix ( ). "../" . rsync . --suffix=SUFFIX --backup (-b) . --backup-dir ~ . --update, -u rsync . ( .) . . . TRANSFER RULE . --inplace --update : . --inplace . --inplace rsync : rsync . : o (Hard links) . . <<>> . o () ( ). o . o rsync . (super user) . o delta- transfer rsync . --backup rsync . : . ( ) . copy-on-write . --partial ( ) --partial-dir --delay-updates . --append . --append . . rsync (in-place) ( ). rsync . (rsync <<>> ). ( ) . --append-verify --append (checksum) . . --append . : rsync 3.0.0 ( ) --append --append-verify rsync ( ) --append-verify . --dirs, -d . --recursive <<.>> ( <<.>> <> <> ). --recursive rsync ( ). --dirs --recursive --recursive . --recursive --dirs --files-from --list-only ( --list-only) ( ). --no-dirs ( --no-d) . --old-dirs . --old-dirs, --old-d rsync -r --exclude='/*/*' rsync . --mkpath . rsync . . rsync mkdir -p $DEST_PATH . . rsync COPYING TO A DIFFERENT NAME . --mkpath --relative (-R) . "some/extra/path" : rsync -ai --mkpath host:some/extra/path/*.c some/extra/path/ rsync -aiR host:some/extra/path/*.c ./ --links, -l "non-regular file" . --info=nonreg0 . . (SYMBOLIC LINKS) . --copy-links, -L . . . . --keep-dirlinks (-K) . SYMBOLIC LINKS . --copy-unsafe-links rsync . --relative . . . ".." ".." ( "/.." ) . : ( "/src/subdir/" "/dest/subdir") ( "/src/subdir" "/dest/") ("/src") "subdir" . --links . --copy-unsafe-links --copy-links . SYMBOLIC LINKS . --safe-links rsync . . ( --munge-links) . . --links ( --links --archive) --links . --copy-unsafe-links . --relative . SYMBOLIC LINKS . --insecure-links rsync uid 0 . rsync . . : --backup-dir --temp-dir/-T --partial-dir --link-dest --compare-dest --copy-dest --log-file --password-file --files-from --include-from --exclude-from --filter --write-batch --read-batch. --insecure-links . . : . ( --rsync-path) -- --insecure-links . "insecure links = yes" rsyncd.conf(5) . << (SYMBOLIC LINKS)>> . --confine-root=DIR --insecure-links : DIR . . DIR . --confine-root=/ . (wrapper) rrsync <> . argv : dir-merge . (pull) --delete - ( <<->>) . DIR . -- argv . --insecure-links . . --drop-D : . --munge-links rsync (munge) (unmunge) . <<>> . << >> . rsync rrsync ( rsync ) . -M--munge-links . . --remote-option <> . / --safe-links / . --safe-links ( ). rsync "/rsyncd-munged/" . /rsyncd-munged . rsync ( ). / "munge-symlinks" support . --copy-dirlinks, -k . --copy-links . ( --force --delete ). --keep-dirlinks . --copy-dirlinks . --relative . : rsync -r --relative src/./ src/./follow-me/ dest/ (SYMBOLIC LINKS) . --keep-dirlinks, -K . . "foo" "file" "foo" "bar" . --keep-dirlinks "foo" . --keep-dirlinks "file" "bar" . : --keep-dirlinks --munge-links ! ( ) . bind mount . --copy-dirlinks . (SYMBOLIC LINKS) . --hard-links, -H rsync (hard link) . . . : o ( ) . ( --inplace ). o --link-dest --link-dest --link-dest . rsync . rsync . --inplace ( --inplace ). ( --inc-recursive ) rsync . ( ) ( ). --no-inc-recursive . --perms, -p rsync . ( --chmod rsync .) : o ( ) --executability . o <<>> ( umask ACL ) setgid . --perms --executability rsync cp(1) tar(1) . : ( ) --perms . ( ) --perms --chmod=ugo=rwX ( ). popt ~/.popt ( -Z --no-g ): rsync alias -Z --no-p --no-g --chmod=ugo=rwX : rsync -avZ src/ dest/ (: -a -Z --no-* .) rsync 2.6.7 ( ) --perms . --executability, -E rsync --perms . 'x' . rsync : o rsync 'x' . o rsync 'x' 'r' . --perms . --acls, -A rsync (ACL) ACL . --perms . ACL . ACL --fake-super . --xattrs, -X rsync . system.* . user.* . --fake-super . x . xattr rsync system/user xattr . system : --filter='-x system.*' user user : --filter='-x! user.*' : --filter='-xr *' -X xattr rsync ( --fake-super) ( -XX). " xattrs" --fake-super . --chmod=CHMOD rsync <> . --perms . chmod(1) 'D' 'F' . set-gid : --chmod=Dg+s,ug+w,Fo-w,+X () : --chmod=D2775,F664 g=u o=g g-o. (u g o) rwxXst . g=o,o=. = (u setuid g setgid o sticky ) chmod . --chmod . --perms --executability . --owner, -o rsync ( ) rsync (super- user) ( --super --fake-super ). / . (ID) ( --numeric-ids ). --group, -g rsync ( ) . ( --no-super ) . . (ID) ( --numeric-ids ). --devices rsync . rsync rsync ( --super --fake-super ). rsync "non-regular file" . --info=nonreg0 . --specials rsync fifo . rsync rsync ( --super --fake-super ). rsync "non-regular file" . --info=nonreg0 . -D -D "--devices --specials" . --drop-D rsync . -D "non-regular file" . --no-D . --no-D rdev . --drop-D -- rrsync . . rsync . . rsync : --server rrsync . --remote-option (-M) : rsync -av -M--drop-D src/ host:dest/ --drop-D (push) . --copy-devices rsync ( --write-devices ). rsync . --write-devices rsync . --inplace . rsync root . rsync . --times, -t rsync ( ) . -t ( -a) --ignore-times (-I) . ( rsync -t .) 30 -- rsync 3.0.0 ( 2008) --protocol -- . 1970 rsync . --atimes, -U rsync () . --open-noatime rsync . --open-noatime rsync O_NOATIME ( ) . O_NOATIME rsync . (mount) O_NOATIME atime . --crtimes, -N, rsync (newness) . (birth) . --omit-dir-times, -O rsync . NFS -O . --backup --backup-dir . --inc-recursive . --omit-link-times, -J rsync . --super (super-user) rsync . : --owner ( ) --group --devices. . --no-super . --fake-super rsync / ( ) . ( ) ( ) ( u-s,g-s,o-t ) ( / / ) . ACL ( --acls) ( --xattrs) . ACL . --fake-super . --remote-option (-M) : rsync -av -M--fake-super /src/ host:/dest/ . -M--fake-super . --fake-super -M--super . --super --no-super . fake super rsyncd.conf . --sparse, -S (sparse) . . --inplace ( ) --whole-file . rsync 3.1.3 ( ) --sparse --inplace . --preallocate . rsync fallocate(2) posix_fallocate(3) Cygwin glibc (null) . rsync . extent ( ext4 xfs NTFS ) . --sparse ( ) . --dry-run, -n rsync . --verbose (-v) / --itemize-changes (-i) rsync . --itemize-changes ( ) . . --progress "bytes sent" "bytes received" "literal data" "matched data" "speedup" . --whole-file, -W (delta-transfer) rsync . ( "" ) . (batch-writing) . --no-whole-file, --no-W . rsync ( --inplace) . --whole-file . --checksum-choice=STR, --cc=STR . ( --checksum ). . : o auto ( ) o xxh128 o xxh3 o xxh64 ( xxhash) o md5 o md4 o sha1 o none ( ) rsync --version . ( ) <> --whole-file . ( ) <> --checksum . <> rsync : 3.2.0 ( ) . . rsync . rsync ( MD5 MD4 ). RSYNC_CHECKSUM_LIST . <<&>> << & >> . ( ) . <> . . --checksum-choice . --one-file-system, -x rsync . rsync . rsync <> . rsync (mount-point) . ( ). rsync ( --copy-links --copy-unsafe-links) . . --ignore-non-existing, --existing rsync ( ) . --ignore-existing ( ). TRANSFER RULE (exclude) . --ignore-existing rsync ( ). --ignore-non-existing. TRANSFER RULE (exclude) . --link-dest . --link-dest ( ) --ignore-existing ( ). . --info=skip2 rsync "FILENAME exists (INFO)" INFO "type change" "sum change" ( -c) "file change" ( ) "attr change" "uptodate" . --info=skip1 ( -v ) INFO . --remove-source-files rsync ( ) . . rsync . rsync ( "foo.new" "foo" --exclude='*.new' rsync). rsync . rsync . --delete rsync ( ) . rsync ( "dir" "dir/") ( "dir/*") rsync . --delete-excluded ( include/exclude FILTER RULES ). --recursive --dirs (-d) . . ! --dry-run (-n) . / (I/O) . ( NFS) . --ignore-errors . --delete --delete-WHEN --delete-excluded . --delete-WHEN rsync rsync 3.0.0 ( ) --delete-during rsync --delete-before . --delete-delay --delete-after . --delete-before . --delete ( ) . . ( --timeout ). rsync ( --recursive ). --delete-during, --del . --delete-before . --delete ( ) . --delete-delay ( --delete-during) . --delay-updates / --fuzzy --delete-after --delete-after . ( ). rsync --delete-after ( --recursive ). --delete ( ) . --delete-after . (merge) . rsync ( --recursive ). --delete ( ) . --delete-delay . --delete-excluded / (exclude/include) . ( << >> << >> ) ( <<>> << >> ) . <<>> . ( -f'-sr foo'). / . -f'- foo' -f'-s foo' ( -f'H foo') ( ). (FILTER RULES) . --delete ( ) . --ignore-missing-args rsync ( --files-from) . . (vanished-file) . --delete-missing-args () --ignore-missing-args : ( ). --force --delete . . --list-only "*missing" . --ignore-errors --delete I/O . --force rsync . ( --delete ). --max-delete=NUM rsync NUM . . rsync ( ) 25 ( ). --max-delete=0 . : rsync 3.0.0 ( ) --max-delete=0 rsync --max-delete=-1 . ( 3.0.0 --max-delete=-1 .) --max-size=SIZE rsync SIZE . --max-size=1.5m. TRANSFER RULE (exclude) . B () K () M () G () T () P () . "ib" ( "G" "GiB") . "B" ( "kb") . . "+1" "-1" . 8192P-1 . : --max-size=1.5mb-1 --max-size=2g+1 . --min-size=SIZE rsync SIZE . SIZE --max-size . --max-alloc=SIZE rsync malloc/realloc 1GB . rsync . rsync . . SIZE --max-size . . 3.2.7 0 SIZE_MAX ( ) . 3.5.0 0 ( 0 ). . RSYNC_MAX_ALLOC SIZE . rsync --max-alloc --max-alloc=1g rsync ( "1G" ). --block-size=SIZE, -B rsync . . . SIZE --max-size . --rsh=COMMAND, -e rsync . rsync ssh . [user@]host::module/path COMMAND rsync rsync . USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION . RSYNC_PORT . 0 rsync --port rsync:// ( rsync://host.example.com:984). rsync SSL stunnel RSYNC_PORT . COMMAND COMMAND rsync . ( ) ( ) . ( rsync ). : -e 'ssh -p 2234' -e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"' ( ssh .ssh/config .) RSYNC_RSH -e . --blocking-io . --rsync-path=PROGRAM rsync . rsync ( --rsync-path=/usr/local/bin/rsync). PROGRAM rsync . --relative . : rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/ --remote-option=OPTION, -M . --log-file=FILE --fake-super : rsync -av -M --log-file=foo -M--fake-super src/ dest/ . : rsync -av -x -M--no-x src/ dest/ rsync . -M . rsync remote-option rsync --old-args . <<>> <<>> . popt ( -M--log-file=/tmp/foo). popt popt rsync . --cvs-exclude, -C . CVS . ( -- (FILTER RULES) ): RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/ .git/ .hg/ .bzr/ $HOME/.cvsignore CVSIGNORE ( cvsignore ). .cvsignore . / rsync . cvs(1) . -C --filter CVS -C . . CVS -C --filter=:C --filter=-C ( ":C" "-C" ). .cvsignore . CVS . --filter=RULE, -f . . --filter . rsync . (_) . (FILTER RULES) . -F -F --filter . : --filter='dir-merge /.rsync-filter' rsync .rsync-filter . -F : --filter='exclude .rsync-filter' .rsync- filter . << (FILTER RULES)>> . --exclude=PATTERN --filter (exclude) . -f'- PATTERN' . << (FILTER RULES)>> . --exclude-from=FILE --exclude FILE ( ) . ';' '#' ( ). "- " ( ) "+ " ( ) ( ). . "!" . FILE '-' . --include=PATTERN --filter (include) . -f'+ PATTERN' . << (FILTER RULES)>> . --include-from=FILE --include FILE ( ) . ';' '#' ( ). "- " ( ) "+ " ( ) ( ). . "!" . FILE '-' . --files-from=FILE rsync FILE ( FILE '-' ) . rsync : o --relative (-R) ( --no-relative --no-R ). o --dirs (-d) ( --no-dirs --no-d ). o --archive (-a) --recursive (-r) . o rsync --files-from ( -a --files-from --no-R ). FILE : ".." -- "../foo" "foo" . ".." ( ) . ';' '#' . : rsync -a --files-from=/tmp/foo /usr remote:/backup /tmp/foo "bin" ( "/bin") /usr/bin /backup/bin . "bin/" ( ) . -r ( -r --files-from -a ). -r ( ) -- (/usr ) . ":host" --files-from ( ). ":" << >> . : rsync -a --files-from=:/path/file-list src:/ /tmp/copy /path/file-list "src" . --iconv --secluded-args --files-from (charset) . : --files-from rsync . ( ) rsync . --from0, -0 rsync ('\0') NL CR CR+LF. --exclude-from --include-from --files-from --filter . --cvs-exclude ( .cvsignore ). --old-args rsync . "." . rsync << >> ( ) (escape) . (wildcard) * ? [ ] ( ) --usermap . . . RSYNC_OLD_ARGS . "1" rsync . "2" ( ) . "0" . ( --no-old-args ). . . --secluded-args . --secluded-args, -s rsync . rsync . rsync . . rsync 3.0.0 ( ) . (restricted shells) . --iconv . . --files-from . RSYNC_PROTECT_ARGS . . ( --no-s --no-secluded-args ). RSYNC_OLD_ARGS . --old-args . --protect-args ( .. ) ( -s ). --trust-sender . ( rsync ). rsync rsync : o . o ( ). . : o (per-directory) . o --old-args . o files-from . o --read-batch . . . SECURITY . --copy-as=USER[:GROUP] rsync USER ( ) GROUP . rsync . . rsync root root . rsync root rsync remote-shell root . . --remote-option -M--copy-as=joe. lsh ( lsh.sh) "localhost:" "lh:" ( "lh" ). rsync "joe" : sudo rsync -aiv --copy-as=joe host1:backups/joe/ /home/joe/ "joe" (timed exploit) joe . "joe" "dest/" ( support/lsh $PATH ): sudo rsync -aive lsh -M--copy-as=joe src/ lh:dest/ --temp-dir=DIR, -T rsync DIR (scratch) . . DIR . . ( ) rsync . rsync . ( ) . --delay-updates . rsync --partial-dir rsync rsync partial-dir . ( --partial-dir .) --fuzzy, -y rsync . rsync . rsync . --compare-dest --copy-dest --link-dest . --delete --delete-after . --compare-dest=DIR rsync DIR ( ). DIR . (sparse backup) . ( ) . --compare-dest rsync . . DIRs . DIR . --copy-dest --link-dest . : compare-dest rsync . --copy-dest=DIR --compare-dest rsync DIR . (flash-cutover) . --copy-dest rsync . DIRs . DIR . --compare-dest --link-dest . --link-dest=DIR --copy-dest DIR (hard link) . ( ) . : rsync -av --link-dest=$PWD/prior_dir host:src_dir/ new_dir/ . rsync (mount option) root (squish) ( "Ignore ownership on this volume" OS X). --link-dest rsync ( ). . DIRs . (symlink) (device node) FIFO rsync -- macOS APFS HFS+ . . : link(2) EPERM . . . --hard-links (-H) . -- -- . --link-dest : DIR . . (itemizing) . 3.1.0 ( ) ( ). --ignore-times rsync . DIR . --compare-dest --copy-dest . rsync 2.6.1 ( ) ( ) --owner (-o) --link-dest . -o ( --no-o) rsync . --compress, -z rsync -- . rsync --compress-choice (--zc) . rsync --version . 3.2.0 ( ) . . rsync . rsync "zlib" . RSYNC_COMPRESS_LIST . "&" "client string & server string" . ( ) . . rsync -z -zz zlib . rsync -zz . --compress-choice=STR, --zc=STR --compress . --compress "none" --no-compress . : o zstd o lz4 o zlibx o zlib o none rsync --version ( ). --old-compress --new-compress rsync --compress-choice=zlib --compress-choice=zlibx rsync . rsync . <> <> ( zlib). --compress-level=NUM, --zl=NUM ( --compress -z). << >> --compress ( zlib 0 <<>> ). . rsync ( rsync ) --compress-choice (--zc) . : rsync -aiv --zc=zstd --zl=22 host:src/ dest/ zlib zlibx 1 9 6 . --zl=0 --zl=-1 6 . zstd -131072 22 3 . 0 3 . lz4 0 . . --zl=999999999 . --debug=nstr << >> . "Client compress: zstd (level 3)" ( ) . --compress-threads=NUM, --zt=NUM . 1 1 . . . : o zstd ( libzstd ) --compression-choice . --skip-compress=LIST : . . rsync . <<>> . . LIST ( ) (/) . . : ( "[:alpha:]" '-' ). (*) (?) . ( ): --skip-compress=gz/jpg/mp[34]/7z/bz2 skip-compress rsync : 3g2 3gp 7z aac ace apk avi bz2 deb dmg ear f4v flac flv gpg gz iso jar jpeg jpg lrz lz lz4 lzma lzo m1a m1v m2a m2ts m2v m4a m4b m4p m4r m4v mka mkv mov mp1 mp2 mp3 mp4 mpa mpeg mpg mpv mts odb odf odg odi odm odp ods odt oga ogg ogm ogv ogx opus otg oth otp ots ott oxt png qt rar rpm rz rzip spx squashfs sxc sxd sxg sxm sxw sz tbz tbz2 tgz tlz ts txz tzo vob war webm webp xz z zip zst --skip-compress : rsync ( ). --numeric-ids rsync (ID) . rsync . uid 0 0 / --numeric-ids . . use chroot rsyncd.conf chroot rsync . --usermap=STRING, --groupmap=STRING . STRING FROM:TO . FROM TO . FROM TO FROM (wild-card) ( ID '*' ). ID : LOW-HIGH. : --usermap=0-99:nobody,wayne:admin,*:normal --groupmap=usr:1,1:usr . --usermap / --groupmap . 0 0 ( "root") . FROM . TO . (ID) . "*" . : --usermap=:nobody --groupmap=*:nobody FROM . "*" . --numeric-ids . FROM . --usermap (super-user) ( --super --fake-super ). --groupmap . --usermap --owner (-o) --groupmap --group (-g) ( rsync ). rsync (wildcard) -s rsync . --chown=USER:GROUP USER GROUP . --usermap --groupmap . USER GROUP / . GROUP USER . "--chown=foo:bar" "--usermap=*:foo --groupmap=*:bar" ( --owner / --group). rsync (wildcard) -s rsync . --timeout=SECONDS / (I/O) . rsync . 0 . --contimeout=SECONDS rsync rsync . rsync . --address=ADDRESS rsync rsync (wildcard) (bind) . --address IP ( ) . --address . --port=PORT TCP 873 . (::) rsync ( URL URL ). --port . --sockopts=OPTIONS . ( !) . setsockopt() . . rsync . --sockopts . --blocking-io rsync I/O (blocking) . rsh remsh rsync I/O I/O . ( ssh I/O .) --outbuf=MODE . None ( Unbuffered) Line Block ( Full) . . Full Line rsync . --itemize-changes, -i . --out-format='%i %n%L' . rsync 2.6.7 ( 2006) . -vv rsync . "%i" . YXcstpoguax Y X . Y : o < (). o > (). o c / ( ). o h ( --hard-links). o . ( ). o * ( "deleting"). X : f d L D S ( fifo). : o "." - . o "+" - . o " " - ( ). o "?" - ( rsync ). o . : o c (checksum) ( --checksum) . rsync 3.0.1 ( ) checksum . o s . o t ( --times). T / / --times . o p (permissions) ( --perms). o o ( --owner ). o g ( --group ). o o u|n|b : u () ( --atimes) o n () ( --crtimes) o b o a ACL . o x (extended attributes) . : "%i" "*deleting" ( rsync ). --out-format=FORMAT rsync . (%) . --info=name -v "%n%L" ( ). log format rsyncd.conf . --out-format --info=name ( / ). (%i) ( --itemize-changes ) ( 2.6.4 ). "%i" --itemize-changes . rsync out-format . --progress rsync ( out-format ). --log-file=FILE rsync . / . "%i %n%L" . --log-file-format . : rsync -av --remote-option=--log-file=/tmp/rlog src/ dest/ . --log-file . --log-file-format=FORMAT --log-file ( ) . . log format rsyncd.conf . (FORMAT) --log-file '%i %n%L' . --log-file-format . --stats rsync (delta-transfer) rsync . -v --info=stats2 -v --info=stats3 . : o Number of files <<>> ( ) . ( ). : "(reg: 5, dir: 3, link: 2, dev: 1, special: 1)" . . o Number of created files <<>> ( ) ( ). ( ). o Number of deleted files <<>> ( ) . ( ). ( .. ). o Number of regular files transferred delta-transfer rsync . o Total file size . . o Total transferred file size . o Literal data . o Matched data . o File list size . rsync . o File list generation time . rsync . o File list transfer time ( ) . o Total bytes sent rsync . o Total bytes received rsync . <<>> (verbose) . --8-bit-output, -8 rsync (high-bit) ( ) (unescaped) (locale) . ( ) (escaped). 2.6.7 ( ) (\) (#) () . <<\#012>> . (0-9) . --human-readable, -h . : 1. ( ). 2. ( -- ). 3. . . -h . --no-human-readable (--no-h) ( ). : K () M () G () T () P (). 1.23M ( ). : rsync 3.1.0 ( ) . -h -h --no-h . --list-only . --partial rsync . . --partial rsync . --partial-dir=DIR --partial . DIR . rsync . --whole-file ( ) partial-dir ( rsync delta-transfer ). rsync DIR -- . ( "--partial-dir=.rsync-partial") rsync (partial-directory) . partial-dir . partial-dir rsync (exclude) . partial-dir partial-dir . : --partial-dir <<>> (perishable) : -f '-p .rsync-partial/' // (exclude/hide/protect) partial-dir : 1. 2. rsync (override) . rsync partial --delete-after <<>> (risk) -f 'R .rsync-partial/'. --delete-before --delete-during rsync partial-dir . : partial-dir ! "/tmp" ! partial-dir RSYNC_PARTIAL_DIR . --partial --partial . --partial-dir=.rsync-tmp --progress RSYNC_PARTIAL_DIR=.rsync-tmp -P .rsync-tmp . --partial : 1. --inplace ( --inplace --partial-dir ) 2. --delay-updates ( ). rsync partial-dir (in-place) ( dest + tmp dest + partial + tmp). 3.2.0 ( 2020) . "refuse options" --partial-dir --partial . --partial --partial-dir . --delay-updates . ( ) . .~tmp~ --partial-dir . --partial-dir .~tmp~ .~tmp~ rsync . --inplace --append . --no-inc-recursive . ( ) . --partial-dir : 1. ( ) 2. ( ). ( --link-dest ) "atomic-rsync" "support" . --prune-empty-dirs, -m rsync . rsync include/exclude/filter . TRANSFER_RULES . . . perishable . "protect" . "emptydir" : --filter 'protect emptydir/' .pdf .pdf ( exclude hide ): rsync -avm --del --include='*.pdf' -f 'hide,! */' src/ dest --include='*/' --exclude='*' hide ( ). --progress rsync . . rsync --info=flist2,name,progress info ( --info=flist0 --progress). rsync : 782448 63% 110.64kB/s 0:00:04 . . (delta-transfer) rsync . (literal data) . rsync : 1,238,099 100% 146.38kB/s 0:00:08 (xfr#5, to-chk=169/396) ,, . rsync (file- list) ( ). (incremental recursion scan) rsync "ir-chk" ( ) "to-chk" "to-chk" . "ir-chk" ( ). -P -P "--partial --progress" . . --info=progress2 . ( -v --info=name0 ). ( --info=progress2 --progress .) SIGINFO SIGVTALRM rsync . BSD SIGINFO Ctrl+T ( SIGINFO ). ( ). ( ) --info=progress2 . rsync ( ). : SIGVTALRM rsync ( .. ) (kill). --password-file=FILE rsync ( FILE - ) . ( ). FILE (world readable) rsync root root rsync . ssh . rsync ( ). --early-input=FILE rsync stdin "early exec" . ( "post-xfer exec" /unmount ). 3.2.1 ( ) . --list-only . : 1. 2. . : . : (wild-card) . : rsync -av --list-only foo* dest/ : drwxrwxr-x 4,096 2022/09/30 12:53:11 support -rw-rw-r-- 80 2005/01/11 10:37:37 support/Makefile --human-readable (-h) . ( ). -h . ( ) --no-h . : rsync 2.6.3 ( ) . --dirs --recursive rsync . --no-dirs ( ) : -r --exclude='/*/*'. --bwlimit=RATE . RATE ( --bwlimit=1.5m). ( "K" "KiB" ). --max-size . 0 . KiB 1024 . rsync rsync . rsync . --progress . . . --bwlimit . --stop-after=MINS, (--time-limit=MINS) rsync . rsync rsync . . --remote-option (-M) . --time-limit . --stop-at=y-m-dTh:m rsync . year-month- dayThour:minute ( 2000-12-31T23:59) . () . / . . rsync . "1-30" ( ) "14:00" : "1" "31" ":59" . rsync rsync . . --remote-option (-M) . . --fsync fsync . . --write-batch=FILE --read-batch . " (BATCH MODE)" --only-write-batch . checksum compress md5/md4/zlib . zstd lz4 . --only-write-batch=FILE --write-batch . --read-batch . : ( ). (push) ( pull ). --read-batch=FILE FILE --write-batch . FILE - . << (BATCH MODE)>> . --protocol=NUM . rsync . rsync 2.6.4 --write-batch --read-batch rsync 2.6.3 <<--protocol=28>> ( rsync ). --iconv=CONVERT_SPEC rsync . <<.>> CONVERT_SPEC rsync (locale) . --iconv=LOCAL,REMOTE --iconv=utf8,iso88591. (push) (pull) . --no-iconv <<->> CONVERT_SPEC . RSYNC_ICONV . iconv <> . --secluded-args (-s) rsync . --files-from . rsync ( include/exclude) . . include/exclude . --iconv rsync <> . ( --iconv=utf8). --ipv4, -4 --ipv6, -6 rsync ssh IPv4/IPv6 . rsync rsync -4 -6 ssh rsync ssh . <<--rsh SHELL -4>> ( IPv4/IPv6 ) . . rsync IPv6 --ipv6 . rsync --version <> . --checksum-seed=NUM (seed) NUM . MD4 ( ). time() . . NUM rsync time() . (DAEMON OPTIONS) rsync : --daemon rsync . rsync host::module rsync://host/module/ . rsync inetd . (rsyncd.conf) . rsyncd.conf(5) . --address=ADDRESS rsync --daemon (wildcard) . --address IP ( ) . --config (virtual hosting) . address rsyncd.conf --address . --bwlimit=RATE . --bwlimit . --bwlimit . --config=FILE . --daemon . /etc/rsyncd.conf (super-user) rsyncd.conf ( $HOME) . --dparam=OVERRIDE, -M rsync . . . : rsync --daemon -M pidfile=/path/rsync.pid --no-detach rsync . Cygwin rsync daemontools System Resource Controller AIX . --no-detach rsync . rsync inetd sshd . --port=PORT TCP 873 . --port port rsyncd.conf . --log-file=FILE rsync "log file" . --log-file . --log-file-format=FORMAT rsync "log format" FORMAT . "transfer logging" . --log-file-format . --sockopts socket options rsyncd.conf . --sockopts . --verbose, -v . (verbosity) "max verbosity" . --verbose . --ipv4, -4 or --ipv6, -6 rsync rsync IPv4/IPv6 . IPv6 ( "address already in use" --ipv6 --ipv4 ). . rsync IPv6 --ipv6 . rsync --version "no IPv6" . --help, -h --daemon rsync . (FILTER RULES) : o o o xattrs . . INCLUDE/EXCLUDE (SIMPLE INCLUDE/EXCLUDE RULES) include exclude . rsync . / / . exclude / . include exclude . . include . include exclude . (exclude) . . / (include/exclude) . . "a/path" "a/path/down/deep/wanted.txt" "a/path" "a/path/down" "a/path/down/deep" . rsync . --debug=FILTER ( ) -M--debug=FILTER FILTER . 3.2.4 "foo " ( ) "foo" . << >> (PATTERN MATCHING RULES) ( ) . . / (SIMPLE INCLUDE/EXCLUDE EXAMPLE) : mkdir x/ touch x/file.txt mkdir x/y/ touch x/y/file.txt touch x/y/zzz.txt mkdir x/z/ touch x/z/file.txt rsync "x/y/file.txt" "/tmp/x/y/file.txt" : rsync -ai -f'+ x/' -f'+ x/y/' -f'+ x/y/file.txt' -f'- *' x host:/tmp/ : -R ( ): rsync -aiR x/y/file.txt host:/tmp/ "x" ( ). "/tmp/x/file.txt" "y" "z" : rsync -ai -f'+ file.txt' -f'- *' x/ host:/tmp/x/ zzz.txt <> : rsync -ai -f'- zzz.txt' x host:/tmp/ (FILTER RULES WHEN DELETING) include exclude ( ) ( ) . . FILTER RULES IN DEPTH . exclude include ( ). -- . exclude C . .o ( ) (object file) ( ). : rsync -ai --del -f'- *.o' -f'- cmd' src host:/dest/ -f'-p *.o' -f'- *.o' . <

> FILTER RULE MODIFIERS . (wildcard) . -f -_*.o -f -_cmd ( ) . (FILTER RULES IN DEPTH) rsync include/exclude . --include --exclude --include-from --exclude-from . <<->> <<+>> . exclude <<- name>> ( ) include <<+ name>> ( ) . rsync / . : RULE [PATTERN_OR_FILENAME] RULE,MODIFIERS [PATTERN_OR_FILENAME] RULE . <<,>> RULE MODIFIERS . PATTERN FILENAME ( ) (_) . / . : exclude, '-' (exclude) ( ) hide protect . include, '+' (include) ( ) show risk . merge, '.' merge-file . dir-merge, ':' merge-file . --trust-sender . hide, 'H' . - -f'H foo' -f'-s foo' . show, 'S' . - -f'S foo' -f'+s foo' . protect, 'P' . - -f'P foo' -f'-r foo' . risk, 'R' . - -f'R foo' -f'+r foo' . clear, '!' / (include/exclude) ( ) ( merge dir-merge) '#' ( ). --filter --include --exclude / . merge-file --filter --include-from / --exclude-from . (PATTERN MATCHING RULES) . rsync . : o / ( ) "**" ( ) . / ( ) "**" . foo "foo" foo/bar ( ). o / (symlink) (device). o / (anchor) . /foo/** /foo/bar/** . . ANCHORING INCLUDE/EXCLUDE PATTERNS . rsync (wildcard) : '*' '?' '[' : o '?' (/) . o '*' . o '**' . o '[' [a-z] [[:alpha:]] . o *** . <> <> ( <> ) ( <> ) . o (escape) . <> <> <> <<\b>> <> . / (exclude/include) : o -f'- *.o' .o o -f'- /foo' ( ) foo o -f'- foo/' foo o -f'- foo/*/bar' / bar foo ( foo ) o -f'- /foo/**/bar' / bar foo ( /foo/bar ) o -f'+ */' -f'+ *.c' -f'- *' .c o -f'+ foo/' -f'+ foo/bar.c' -f'- *' foo foo/bar.c ( foo <<- *>> ) (FILTER RULE MODIFIERS) (+) (-) : o / / . -f'-/ /etc/passwd' passwd "/etc" "-/ subdir/foo" "foo" "subdir" "foo" . o ! / . -f'-! */' . o C CVS-exclude <<-C>> . . o s . . --delete-excluded . hide (H) show (S) / . o r . . s . protect (P) risk (R) include/exclude . o p (perishable) . --cvs-exclude (-C) "CVS" "*.o" . o x xattr / xattr ( / ). xattr xattr ( --xattrs ). (MERGE-FILE FILTER RULES) merge (.) dir-merge (:) ( (FILTER RULES) ). -- ('.') - (':'). "." . - rsync . - . ( PER-DIRECTORY RULES AND DELETE ). : merge /etc/rsync/default.rules . /etc/rsync/default.rules dir-merge .per-dir-filter dir-merge,n- .non-inherited-per-dir-excludes :n- .non-inherited-per-dir-excludes merge dir-merge : o - exclude . o + include . o C CVS . 'n' 'w' '-' (!) . ".cvsignore" . o e "dir-merge,e .rules" "dir-merge .rules" "- .rules" . o n . o w (whitespace) . . : "- foo + bar" ( ). o <<+>> <<->> ( ) ( ! ). "merge,-/ .excl" .excl "dir-merge,s .filt" ":sC" - (per-directory) . ( s r ) ( hide). - 'n' . - . dir-merge dir-merge . ("!") - . dir-merge (anchor) . - "/foo" "foo" dir- merge . --filter=". file" : merge /home/user/.global-filter - *.gz dir-merge .rules + *.[ch] - *.o - foo* /home/user/.global-filter ".rules" - . ( ). - rsync - . ( -F ): --filter=': /.rsync-filter' rsync .rsync-filter . (: rsync "path" .) -: rsync -avF /src/path/ /dest/dir rsync -av --filter=': ../../.rsync-filter' /src/path/ /dest/dir rsync -av --filter=': .rsync-filter' /src/path/ /dest/dir <> <<.rsync-filter>> <> <> . <<.rsync-filter>> . <<.cvsignore>> <<:C>> (dir-merge) .cvsignore CVS . <<:C>> per-directory .cvsignore --cvs-exclude (-C) . rsync .cvsignore ( ). : cat < rsync . per- directory .cvsignore . :C . CVS ( $HOME/.cvsignore $CVSIGNORE) -C <<-C>> <<--filter=-C>>. (LIST-CLEARING FILTER RULE) / (include/exclude) <> ( (FILTER RULES) ) . <<>> ( ) (per-directory) ( ). / (ANCHORING INCLUDE/EXCLUDE PATTERNS) include/exclude << >> ( per-directory ). (transfer-root) . / . --relative ( ). . <> <>. : Example cmd: rsync -a /home/me /home/you /dest +/- pattern: /me/foo/bar +/- pattern: /you/bar/baz Target file: /dest/me/foo/bar Target file: /dest/you/bar/baz Example cmd: rsync -a /home/me/ /home/you/ /dest +/- pattern: /foo/bar (note missing "me") +/- pattern: /bar/baz (note missing "you") Target file: /dest/foo/bar Target file: /dest/bar/baz Example cmd: rsync -a --relative /home/me/ /home/you /dest +/- pattern: /home/me/foo/bar (note full path) +/- pattern: /home/you/bar/baz (ditto) Target file: /dest/home/me/foo/bar Target file: /dest/home/you/bar/baz Example cmd: cd /home; rsync -a --relative me/foo you/ /dest +/- pattern: /me/foo/bar (starts at specified path) +/- pattern: /you/bar/baz (ditto) Target file: /dest/me/foo/bar Target file: /dest/you/bar/baz --verbose / ( --dry-run ). (PER-DIRECTORY RULES AND DELETE) . 'e' : rsync -av --filter=': .excl' --exclude=.excl host:src/dir /dest rsync -av --filter=':e .excl' host:src/dir /dest . --delete-after : rsync -avF --delete-after host:src/dir /dest ( ) . ( .rules ): rsync -av --filter=': .rules' --filter='. /my/extra.rules' --delete host:src/dir /dest extra.rules ( ) .rules . .rsync-filter .rsync-filter . ( ) . : rsync -av --filter=':e /.rsync-filter' --delete host:src/dir /dest rsync -avFF --delete host:src/dir /dest (TRANSFER RULES) (FILTER RULES) ( ) . (generator) (exclude) . . ( ) . "foo" . "foo" . ( hide) "foo" ( protect) "foo" . --prune-empty-dirs . . " (quick check)" ( ) --update --max-size --ignore-non-existing . (BATCH MODE) . . . rsync write-batch . write-batch rsync " (batch file)" . . (multicast) . rsync read-batch . rsync . write-batch : ".sh". . Bourne ( Bourne) . . : $ rsync --write-batch=foo -a host:/source/dir/ /adest/dir/ $ scp foo* remote: $ ssh remote ./foo.sh /bdest/dir/ $ rsync --write-batch=foo -a /source/dir/ /adest/dir/ $ ssh remote rsync --read-batch=- -a /bdest/dir/ rsync /adest/dir/ /source/dir/ "foo" "foo.sh" . "remote" /bdest/dir . : o -- rsync / . o "foo.sh" rsync read-batch . o . foo.sh --read-batch ( --exclude-from=- ). : read-batch . ( ) . read-batch . -I ( ) . . rsync ( ) . rsync . rsync rsync . --protocol rsync rsync . ( 2.6.3 ( ) .) (batch file) rsync . ( ) . --write-batch --read-batch --files-from --filter / --include / --exclude --delete . BATCH.sh filter/include/exclude "here" . --delete . --read-batch . (SYMBOLIC LINKS) rsync . . "skipping non-regular" . --links ( ) . --archive --links . --copy-links "" (collapse) . rsync <<>> (safe) <<>> (unsafe) . (mirror) rsync /etc/passwd . --copy-unsafe-links . --safe-links . ( --safe-links --links .) ( / ) ".." . . : --copy-links ( ). --copy-dirlinks . --links --copy-unsafe-links . --copy-unsafe-links . --links --safe-links . --links . --munge-links . --keep-dirlinks rsync . . (DIAGNOSTICS) rsync . "protocol version mismatch -- is your shell clean?" . rsync . : ssh remotehost /bin/true > out.dat out.dat . out.dat . rsync out.dat . . ( .cshrc .profile) . -vv . rsync . (EXIT VALUES) o 0 - o 1 - o 2 - o 3 - / o o 4 - . : o o 5 - - o 10 - / o 11 - / o 12 - rsync o 13 - o 14 - IPC o 15 - ( core dumped). o 16 - ( ). o 19 - SIGUSR1 . o 20 - SIGINT SIGTERM SIGHUP . o 21 - waitpid() o 22 - o 23 - o 24 - o 25 - --max-delete o 30 - / o 35 - (ENVIRONMENT VARIABLES) CVSIGNORE CVSIGNORE .cvsignore . --cvs-exclude . RSYNC_ICONV --iconv . RSYNC_OLD_ARGS "1" --old-args "2" ( ) "0" . RSYNC_PROTECT_ARGS . --old-args --no-old-args --secluded-args . 3.2.4 ( 2022) . RSYNC_PROTECT_ARGS --secluded-args . --secluded-args --no-secluded-args --old-args . 3.2.4 ( 2022) RSYNC_OLD_ARGS . RSYNC_RSH rsync . --rsh (-e). RSYNC_PROXY rsync rsync . RSYNC_PROXY hostname:port . RSYNC_PASSWORD daemon rsync . ssh ( ). USER or LOGNAME USER LOGNAME rsync . "nobody" . USER . RSYNC_PARTIAL_DIR --partial . --partial-dir . RSYNC_COMPRESS_LIST . rsync --version . --compress . RSYNC_CHECKSUM_LIST (checksum) . rsync --version . --checksum-choice . RSYNC_MAX_ALLOC --max-alloc . RSYNC_PORT rsync . rsync-ssl . HOME .cvsignore . RSYNC_CONNECT_PROG . CONNECTING TO AN RSYNC DAEMON . RSYNC_SHELL RSYNC_CONNECT_PROG . CONNECTING TO AN RSYNC DAEMON . (FILES) /etc/rsyncd.conf rsyncd.conf (SEE ALSO) rsync-ssl(1), rsyncd.conf(5), rrsync(1) (BUGS) o time_t . o FAT rsync . --modify-window . o . o --delete . ! : . (VERSION) 3.5.0 rsync . (INTERNAL OPTIONS) --server --sender rsync . rsync . support rsync rrsync ( rsync ) ssh . (CREDITS) Rsync GNU General Public License . COPYING . rsync : . FAQ-O-Matic . rsync: . . rsync@lists.samba.org . zlib Jean-loup Gailly Mark Adler . (THANKS) : John Van Essen Matt McCutchen Wesley W. Terpstra David Dykstra Jos Backus Sebastian Krahmer Martin Pool J.W. Schultz. Richard Brent Brendan Mackay Bill Waite Stephen Rothwell David Bell. . (AUTHOR) rsync Andrew Tridgell Paul Mackerras . . Wayne Davison 2004 2024 rsync . . rsync 3.5.0 13 Aug 2026 rsync(1)