Last active
November 26, 2020 20:17
-
-
Save kitallis/f005cb3ee9fd70c1e14e52cde8ce1226 to your computer and use it in GitHub Desktop.
backup pictures over rsync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source="/Users/username/Pictures/" | |
destination="<u>@<ip>:/mnt/vol/backup/" | |
# 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 11 * * * yourusername ~yourusername/bin/backup.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment