Created
May 31, 2014 21:50
-
-
Save richardhsu/0fc52989d6d639466052 to your computer and use it in GitHub Desktop.
Quick backup script to backup my minecraft server folder and potentially other folders to Dropbox.
This file contains hidden or 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 | |
# Backup folders to DropBox | |
# Add folder names relative to home directory. | |
# This file exists at the home directory level. | |
DATE=`date +%Y-%m-%d-%H-%M` | |
FOLDERS=("minecraft") | |
DROPBOX="/home/richardhsu/.dropbox/dropbox.py" | |
for dir in "${FOLDERS[@]}" | |
do | |
echo "Working on $dir" | |
BACKUP_F="Dropbox/Backup/$dir-$DATE.tar.gz" | |
tar -czf $BACKUP_F $dir | |
done | |
python $DROPBOX start | |
sleep 5 # Wait for dropbox to start | |
while [[ $(python $DROPBOX status) != "Up to date" ]]; do | |
sleep 5 # Sleep 5 seconds then check status again | |
done | |
python $DROPBOX stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment