Skip to content

Instantly share code, notes, and snippets.

@kevinkarpenske
Forked from raid5/android_rsync.sh
Created March 27, 2011 04:10
Show Gist options
  • Save kevinkarpenske/888904 to your computer and use it in GitHub Desktop.
Save kevinkarpenske/888904 to your computer and use it in GitHub Desktop.
#!/bin/sh
RSYNC_DEFAULT_OPTIONS="-r -t -v -L --delete --stats --progress"
RSYNC_TEMP_DIR="./tmp_rsync_dir/"
# Sources
ITUNES_PODCASTS_DIR="/Users/adam/Music/iTunes/iTunes Music/Podcasts/"
ITUNES_MUSIC_DIR="/Users/adam/Music/iTunes/iTunes Music/"
ALBUMS=(
"Bone Thugs-N-Harmony/Strength & Loyalty"
"Bone Thugs-N-Harmony/The Collection Volume Two"
"Forever The Sickest Kids/Forever The Sickest Kids"
"Eminem/The Slim Shady LP"
"Rebelution/Bright Side Of Life"
"Rebelution/Courage To Grow"
"Rise Against/Endgame"
"The Ataris/So Long, Astoria"
"The Offspring/Smash"
"Thrice/Beggars"
"Thrice/Vheissu"
)
# Destinations
ATRIX_PODCASTS_DIR="/Volumes/ATRIXSD/Podcasts/"
ATRIX_MUSIC_DIR="/Volumes/ATRIXSD/Music/"
# Sync podcasts
rsync $RSYNC_DEFAULT_OPTIONS "$ITUNES_PODCASTS_DIR" "$ATRIX_PODCASTS_DIR"
# Sync music
for album in "${ALBUMS[@]}"; do
mkdir -p "${RSYNC_TEMP_DIR}${album}"
ln -Fs "${ITUNES_MUSIC_DIR}${album}" "${RSYNC_TEMP_DIR}${album}"
done
rsync $RSYNC_DEFAULT_OPTIONS "$RSYNC_TEMP_DIR" "$ATRIX_MUSIC_DIR"
rm -rf "${RSYNC_TEMP_DIR}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment