Skip to content

Instantly share code, notes, and snippets.

@raid5
Created March 27, 2011 01:58
Show Gist options
  • Save raid5/888840 to your computer and use it in GitHub Desktop.
Save raid5/888840 to your computer and use it in GitHub Desktop.

Revisions

  1. raid5 revised this gist Apr 9, 2011. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions android_rsync.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    #!/bin/sh

    RSYNC_DEFAULT_OPTIONS="-r -t -v --stats --progress"
    RSYNC_DEFAULT_OPTIONS="-r -t -v -L --ignore-existing --delete --stats --progress"
    RSYNC_TEMP_DIR="./tmp_rsync_dir/"

    # Sources
    ITUNES_PODCASTS_DIR="/Users/adam/Music/iTunes/iTunes Music/Podcasts/"
    @@ -14,7 +15,7 @@ ALBUMS=(
    "Rebelution/Courage To Grow"
    "Rise Against/Endgame"
    "The Ataris/So Long, Astoria"
    "The Offspring/Smash"
    "The Rocket Summer/Of Men And Angels"
    "Thrice/Beggars"
    "Thrice/Vheissu"
    )
    @@ -28,5 +29,9 @@ rsync $RSYNC_DEFAULT_OPTIONS "$ITUNES_PODCASTS_DIR" "$ATRIX_PODCASTS_DIR"

    # Sync music
    for album in "${ALBUMS[@]}"; do
    rsync $RSYNC_DEFAULT_OPTIONS "${ITUNES_MUSIC_DIR}${album}" "$ATRIX_MUSIC_DIR"
    done
    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}"
  2. raid5 created this gist Mar 27, 2011.
    32 changes: 32 additions & 0 deletions android_rsync.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    #!/bin/sh

    RSYNC_DEFAULT_OPTIONS="-r -t -v --stats --progress"

    # 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
    rsync $RSYNC_DEFAULT_OPTIONS "${ITUNES_MUSIC_DIR}${album}" "$ATRIX_MUSIC_DIR"
    done