Skip to content

Instantly share code, notes, and snippets.

@karlding
Created January 15, 2018 05:30
Show Gist options
  • Select an option

  • Save karlding/f9e61556cbd128108053a3f08dc767a9 to your computer and use it in GitHub Desktop.

Select an option

Save karlding/f9e61556cbd128108053a3f08dc767a9 to your computer and use it in GitHub Desktop.

Revisions

  1. karlding created this gist Jan 15, 2018.
    15 changes: 15 additions & 0 deletions music-backup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/bash

    # Backup all my music from my Windows Music folder
    # (/media/karl/5A14316614314673/Users/Karl/Music) to my 2 TB external drive
    # (/media/karl/A0D83FDAD83FAE02/bak/Users/Karl/Music) using rsync

    WINDOWS_MEDIA_DIR="/media/karl/5A14316614314673/Users/Karl/Music"
    EXTERNAL_DRIVE="/media/karl/A0D83FDAD83FAE02/bak/Users/Karl"

    rsync -va "${WINDOWS_MEDIA_DIR}" "${EXTERNAL_DRIVE}"

    # Delete files that have been removed from my Music directory from the external
    # First run with --dry-run and check the output, then remove the flag to
    # actually delete
    # rsync -va --dry-run --delete "${WINDOWS_MEDIA_DIR}" "${EXTERNAL_DRIVE}"