Skip to content

Instantly share code, notes, and snippets.

@nateflink
Last active December 18, 2015 13:38
Show Gist options
  • Save nateflink/5790798 to your computer and use it in GitHub Desktop.
Save nateflink/5790798 to your computer and use it in GitHub Desktop.
#!/bin/bash
#by Nate Flink
mysqldump -u $2 -p$3 --extended-insert=false -h $4 $1 > $5
MINSIZE=3
ACTSIZE=$(du -k $5 | cut -f 1)
if [ $ACTSIZE -le $MINSIZE ]; then
echo "Error: the database backup is ${ACTSIZE} kilobytes, needs to be at least ${MINSIZE}"
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment