#!/bin/bash

# rsync -avvz --include '/' --include 'dir1' --include 'dir1/dir2/' --exclude 'dir1/*' --exclude '/*' source/ dest/  # ok
#  rsync -avz /home/gerd-deb /media/gerd/home-230704/
rsync -avz --delete --delete-excluded --exclude='.cache' /home/gerd-deb /media/gerd/home-230704/


# -a =  archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
#       recursive, symlinks, permission, time, group, owner, devices
#       no: ACL, xattrs, access times, create times, hard links
# -z    compress file data during the transfer
#
# --delete                 delete extraneous (belanglos) files from dest dirs
# --delete-excluded        also delete excluded files from dest dirs
# --exclude=PATTERN        exclude files matching PATTERN
# --exclude-from=FILE      read exclude patterns from FILE
# --exclude=PATTERN        exclude files matching PATTERN
# --exclude-from=FILE      read exclude patterns from FILE
# --include=PATTERN        don't exclude files matching PATTERN
# --include-from=FILE      read include patterns from FILE
# --link-dest=DIR          hardlink to files in DIR when unchanged
# --log-file=FILE          log what we're doing to the specified FILE


