Created
January 30, 2016 02:48
-
-
Save woodruffw/c05878242ebdf835bcd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# music-backup: use rsync to back ~/music up to /media/backup/music | |
function installed { | |
local cmd=$(command -v "${1}") | |
[[ -n "${cmd}" ]] && [[ -f "${cmd}" ]] | |
return ${?} | |
} | |
installed rsync || (echo "Fatal: Missing rsync." ; exit 1) | |
[[ -d /media/backup ]] || (echo "Fatal: No backup drive." ; exit 2) | |
[[ -d ~/music ]] || (echo "Fatal: No music directory." ; exit 3) | |
rsync -va ~/music /media/backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment