Skip to content

Instantly share code, notes, and snippets.

Created Oct 21, 2019
What would you like to do?
An example of using rsync to backup three folders in Documents to an external drive, checking that it's mounted first
output=/media/$USER/My\ Passport/vubuntu/
if [ ! -d "$output" ]; then
echo "$output not found, is drive connected to computer?"
exit 1
for folder in "Personal" "Transcripts" "Resume"; do
rsync -avzh /home/$USER/Documents/$folder $output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment