Skip to content

Instantly share code, notes, and snippets.

@karlding
Created January 15, 2018 05:30
Show Gist options
  • Save karlding/f9e61556cbd128108053a3f08dc767a9 to your computer and use it in GitHub Desktop.
Save karlding/f9e61556cbd128108053a3f08dc767a9 to your computer and use it in GitHub Desktop.
#!/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}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment