Skip to content
Snippets Groups Projects
Commit 32a41779 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

mysql dump: return error on dumps without data

parent c6cbbfe3
No related branches found
No related tags found
1 merge request!57mysql dump: return error on dumps without data
......@@ -95,12 +95,13 @@ function mysql.db.dump(){
zgrep -iE "(CREATE|INSERT)" "$_dumpfile" >/dev/null
typeset -i local _rc2=$?
test $_rc2 -ne 0 && echo "ERROR: the dump does not contain an insert statement."
test $_rc2 -ne 0 && echo "ERROR: the dump does not contain any CREATE or INSERT statement."
typeset -i local _rctotal=$?+$_rc2
test $_rctotal -eq 0 && mysql_COUNT_DUMPS+=1
test $_rctotal -eq 0 || mysql_COUNT_ERRORS+=1
test $_rctotal -eq 0
typeset -i local myrc+=$_rc2
test $myrc -eq 0 && mysql_COUNT_DUMPS+=1
test $myrc -eq 0 || mysql_COUNT_ERRORS+=1
test $myrc -eq 0
}
# import [file] --> [database]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment