Created
November 30, 2011 17:20
-
-
Save jonbalbarin/1409879 to your computer and use it in GitHub Desktop.
a bash script for backing up the current directory to dropbox
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 | |
if [[ $1 ]] | |
then | |
BACKUP_ARCHIVE=$(basename $(pwd))_$(date "+%Y-%m-%d-%H%M%S")_\(${1// /-}\).tar.gz | |
echo "backing up to "$BACKUP_ARCHIVE | |
tar -czf $BACKUP_ARCHIVE . | |
cp -pv $BACKUP_ARCHIVE ~/Dropbox/Backups | |
rm -v $BACKUP_ARCHIVE | |
echo done | |
else | |
echo "usage!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment