Skip to content

Instantly share code, notes, and snippets.

@jlizanab
Created July 2, 2013 14:12
Show Gist options
  • Save jlizanab/5909641 to your computer and use it in GitHub Desktop.
Save jlizanab/5909641 to your computer and use it in GitHub Desktop.
Create backup of actual directory on dropbox (bash). You can add this feature to your .bash_profile or .bashrc, and call it from a terminal when you need to back up a folder.
backupOnDropbox(){
STRNOW=`date +"%Y%m%d%H%M"`;
STRNAMEDIR=`basename $PWD`_;
STRDESCFILE='_backup.zip';
zip -r $STRNAMEDIR$STRNOW$STRDESCFILE *
mv $STRNAMEDIR$STRNOW$STRDESCFILE ~/Dropbox/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment