Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@paulbaumgart
Created March 27, 2010 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save paulbaumgart/345714 to your computer and use it in GitHub Desktop.
Save paulbaumgart/345714 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