Skip to content

Instantly share code, notes, and snippets.

@rgbink
Created May 19, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgbink/46581a8ddcf4665f4691 to your computer and use it in GitHub Desktop.
Save rgbink/46581a8ddcf4665f4691 to your computer and use it in GitHub Desktop.
Dropbox Sync Script
#!/bin/bash
# h/t Roger Chen, http://code.rogerhub.com/terminal-fu/53/backing-up-dropbox-with-rsync/
DIR=$HOME/Dropbox
read -p "The target directory is: $DIR. Correct? [yn] " -n 1
if [[ $REPLY =~ ^[Yy]$ ]];then
if [ -d $DIR ];then
echo -e "\n"
rsync -vauzh --progress --exclude '.dropbox*' --delete $DIR home:~/backup/dropbox
echo "Complete."
exit 0
else
echo "Could not find directory. Exiting."
exit 1
fi
else
echo "Exiting."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment