View rsync_clonedir
#!/bin/sh
# Script to clone / backup a directory using rsync excluding certain files that may not be of
# interest for pure archival backups that aren't intended be full fidelity. The intention is
# that the exclude file will be populated with cached data or uninteresting metadata.
# Use sudo to call this script if you need to copy directories where you don't have permissions.
# rsync options:
# -a archive mode; equals -rlptgoD (no -H,-A,-X)
# -x don't cross device boundaries (ignore mounted volumes)