Linux :: Rsync/Rclone

Rsync

rsync -a # archive, preserve permission etc; better than -r
    equals -rlptgoD (no -H, -A, -X)
    -r  recurrsive
    -l  symlinks (-L transfer symlink into file/dir)
    -p  preserve permissions
    -t  preserve modification times
    -g  preserve group
    -o  preserve owner (super user only)
    -D  --devices, --specials, super user only
-A  # preserve ACLs
-X  # --xattrs, extended attributes
-H  # --hard-links
-P # --progress and partial
-z # compression
-v # verbose
-R  # relative path name
-h # human readable
-e "-p 22001" user@example.com:/path/to/remote # specify other in ssh
--exclude '.cache' 
--include 'R*'
--max-size='200k'
--min-size='10k'

--remove-source-files
--delete # delete any files in dest if source does not have it; sync
-n # --dry-run
--bwlimit=100

# can use hostname in ~/.ssh/config
rsync -avhz /path/to/local/dir/ hostname:/path/to/remote/dir

# need trailing slash
rsync -a /folder1/ folder2

Rclone

# use --create-empty-src-dirs to sync/move/copy empty dirs
rclone sync source destination: --create-empty-src-dirs

# check - if not the same, an error will occur
rclone check source dest: --one-way --size-only