Skip to content

Instantly share code, notes, and snippets.

@kebman
Last active September 23, 2015 22:08
Show Gist options
  • Save kebman/d80a6cd7ad9679e55034 to your computer and use it in GitHub Desktop.
Save kebman/d80a6cd7ad9679e55034 to your computer and use it in GitHub Desktop.
Simple shell script to make a folder-to-folder backup of local projects to Dropbox
#!/bin/bash
# Simple folder-to-folder backup of local projects to Dropbox
CORRECTPATH="/home/username/Desktop/local_projects"
CHECKPATH=$(pwd)
if [ $CHECKPATH = $CORRECTPATH ]; then
cp -a ./* ~/Dropbox/local_projects_backup
echo "Backup success! :)"
else
echo "This script can only be executed from $CORRECTPATH"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment