Skip to content

Instantly share code, notes, and snippets.

Last active Nov 26, 2020
What would you like to do?
backup pictures over rsync
# this syncs safely, doesn't trash things on the server if you deleted locally, only accretes, only includes pictures
# for the rest of my mac I just rely on Time Machine backups
# includes a per-file progress bar (from rsync) and an overall progress bar using the pv utility
rsync -Phca --ignore-existing --bwlimit=1000 --stats --include="*" --include="Pictures/Photos Library.photoslibrary/" --include="Pictures/Photos Library.photoslibrary/***" -e "ssh" "$source" "$destination" | pv -lep -s $(rsync -av --dry-run "$source" "$destination" | awk 'NF' | wc -l)
# in bash_profile or equivalent,
alias backup='$HOME/bin/backup'
15 11 * * * yourusername ~yourusername/bin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment