#! /bin/bash
# archive mode, be verbose, use compression, preserve partial files, display progress
rsync -avvzhxP /source /destination/
# turn off compression for local transfers (more for network/internet)
# remote
rsync -avzPe "ssh -i ssh-priv.key" user@server:/data/dir destination/
# options
--ignore-existing # only copy if file doesnt exist yet (filename)
--update # only copy if local file is newer (filedate)
--remove-source-files # move files to remote
rsync -aH -e ssh --delete --exclude Cache --link-dest=yesterdaystargetdir remote1:sourcedir todaystargetdir
-a archive = -rlptgoD
-r recurse into dirs
-l cp symlinks as symlinks
-p preserve permissions
-t prsv. times
-g prsv. groups
-o prsv. owner
-D prsv. device and special files
-h human readable
-u update = skip files that are newer on the receiver
-H prsv. hard-links
-n dry run
—delete delete files from receiver if missing in src
—exclude=dir
—partial keep partially transf. files
-P = —partial und —progress
—link-dest=dir link to previous increment
--log-file=
# usually rsync checks file size and time as heuristic
--ignore-times # ignores size and time, thus transfers all files unconditionally (either delta or --whole-file)
--checksum # only examines size, if size is equal md5 checksum is compared (read whole files)
--checksum