Created
October 21, 2019 20:59
-
-
Save vsoch/5e5467ac654ad83a0c60c75f55053dfd to your computer and use it in GitHub Desktop.
An example of using rsync to backup three folders in Documents to an external drive, checking that it's mounted first
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
#!/bin/bash | |
output=/media/$USER/My\ Passport/vubuntu/ | |
if [ ! -d "$output" ]; then | |
echo "$output not found, is drive connected to computer?" | |
exit 1 | |
fi | |
for folder in "Personal" "Transcripts" "Resume"; do | |
rsync -avzh /home/$USER/Documents/$folder $output | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment