Created
May 8, 2015 16:00
-
-
Save SimplGy/7bfcc52732ecc0df1f66 to your computer and use it in GitHub Desktop.
Backs up your dropbox folder recursively and incrementally to a file named by the month and year. Meant to run as a cron job.
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 | |
echo "Starting Dropbox Backup" | |
echo "-----------------------" | |
echo `date` | |
cd ~ | |
mkdir -p "Dropbox Backups" | |
echo "Archiving './Dropbox' to 'DropBox Backups/Dropbox_YEAR-MM).zip'.." | |
echo "" | |
# add --encrypt to pwd protect | |
zip -r --update --test "Dropbox Backups/Dropbox_$(date +"%Y-%m").zip" ./Dropbox | |
echo "" | |
echo "" | |
echo "Done Archiving." | |
echo "" | |
echo "Printing all empty folders in the '~/Dropbox' which are empty and not in a hidden folder." | |
echo "Be on the lookout for new empty ones, means Dropbox may be messed up:" | |
find ~/Dropbox -type d -empty -not -path '*/\.*' | |
echo "" | |
echo "Total empty folders:" | |
find ~/Dropbox -type d -empty -not -path '*/\.*' | wc -l | |
# find ~/Dropbox -type d -empty -not -path '*/\.*' | tee >(wc -l) | |
echo "" | |
echo "" | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment