Table of Contents

Prev  
 Next
, , , ,

Rsync

These are my rsync notes. I also used to use rsnapshot, however I was unhappy with the performance of this application and moved to restic. The original rsnapshot notes have been rolled up and moved to the bottom of this page.

Rsync Notes

Main rsync command usage summary

A trailing slash (/) at the end of the first argument in the rsync command: rsync -a dir1/ dir2, mean “the contents of dir1”. The alternative, without the trailing slash, would place dir1, including the directory, within dir2. This would create a hierarchy that looks like: ~/dir2/dir1/[files] So;

Where

Always double-check your arguments before executing an rsync command. Rsync provides a method for doing this by passing the -n or -–dry-run options. The -v flag (for verbose) is also necessary to get the appropriate output:

rsync daemon

tl;dr;

Notes on Compression option

Compression option -z can slow down file transfer notes as well as some examples I used

tl;dr;

My web page copy bash batch

sudo vim Myscripts/rsync_shared.sh or to run sudo bash Myscripts/rsync_shared.sh

#Note this is a local only script and takes no additional batch inputs when run!

code

some rsync flag definitions

Simply type rsync at terminal to see a complete list

Flag Short Flag Long Description
-z --compress compress file data during the transfer
-v --verbose increase verbosity
-a --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-r --recursive recurse into directories
-l --links copy symlinks as symlinks
-p --perms preserve permissions
-t --times preserve modification times
-o --owner preserve owner (super-user only)
-g --group preserve group
-D same as –devices –specials
--devices preserve device files (super-user only)
--specials preserve special files
-H --hard-links preserve hard links *
-A --acls preserve ACLs (implies -p)
-X --xattrs preserve extended attributes
-n --dry-run perform a trial run with no changes made
--delete delete extraneous files from destination
-P same as --partial --progress
--partial keep partially transferred files
--progress show progress during transfer
-h --human-readable output numbers in a human-readable format
-u --update skip files that are newer on the receiver
--exclude=PATTERN exclude files matching PATTERN
--numeric-ids don't map uid/gid values by user/group name
-R --relative Use relative paths. This means that the full path names specified on the command line are sent to the server rather than just the last parts of the filenames.
--delete-excluded also delete excluded files from dest dirs

Note(s):



Rsnapshot

These are some rsnapshot and related rsync notes. They are really long! Sadly the original source was only onlie for a few years.

Rsnapshot and Old Rsync notes, really tl;dr;

Prev  
 Next