Skip to content

Instantly share code, notes, and snippets.

@smith
Forked from paulbaumgart/dropbox_backup.sh
Created May 19, 2010 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smith/405859 to your computer and use it in GitHub Desktop.
Save smith/405859 to your computer and use it in GitHub Desktop.
size=`rsync --delete --delete-excluded -pthrv --exclude-from \
/Users/paul/.backup/exclude /Users/paul/Documents/ \
/Users/paul/Dropbox | egrep -o "total size is (.*)G" | egrep -o "[0-9\.]+"`
if [ "$size" = "" ]; then
size=0
fi
if [ `echo "$size < 1.8" | bc` = 0 ]; then
echo "`date`: WARNING: Size is running out for Dropbox backups.\
(Currently using ${size} GB.)" 1>&2
elif [ "$1" != "" ]; then
echo "size: $size GB"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment