Skip to content

Instantly share code, notes, and snippets.

@roblogic
Created November 7, 2022 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roblogic/1e229f1d5f64f4dc58ce261841d232c2 to your computer and use it in GitHub Desktop.
Save roblogic/1e229f1d5f64f4dc58ce261841d232c2 to your computer and use it in GitHub Desktop.
another rsync script
#!/bin/zsh
#set -x
do_sync(){
target=$1
rsync -iPr --size-only --dry-run --delete /Volumes/Seagate-6TB/$target /Volumes/Seagate-8TB \
| grep -e ".mkv$" -e ".mp4$" -e ".avi$"
objects=`rsync -iPr --size-only --dry-run --delete /Volumes/Seagate-6TB/$target /Volumes/Seagate-8TB \
| grep -e ".mkv$" -e ".mp4$" -e ".avi$" | wc -l`
echo
printf "\n$target $objects\nproceed?"
read reply
rsync -iPr --size-only --delete --max-delete=5 /Volumes/Seagate-6TB/$target /Volumes/Seagate-8TB
echo
}
do_sync movies2022
do_sync movies2021
do_sync movies2020
do_sync movies2019
do_sync movies2018
do_sync movies2017
do_sync xbox-live-clips
do_sync @audioBooks
do_sync @eBooks
do_sync @eComics
do_sync @kids
do_sync @movies
do_sync @music
do_sync @tv-series
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment