Originally Posted by clttech
When I tried to restore a db I get the following error
mysql: unknown option '-x'
I used this command backupres db mydata 2014-03-22 /
I was able to restore the database by extracting that one database file and running the import command.
mysql -u root -p mydatabase < mydata.sql
I have just got the same error trying to recover some databases. So I have downloaded the last back-res.sh version just to recover with that script and it worked.
I you just want to fix the recovery part from the script without updating it with all new changes provided by Vrij, then update the code around line 547 with just a section of Vrij script (v.5.6):
for i in $arh ; do
rdb=`echo $i | cut -d "-" -f2`
mysql --user="$dbuser" --password="$dbpassword" --execute "CREATE DATABASE IF NOT EXISTS $rdb;"
$BZIP2 -dc $BACKUPDIR/$YDATE-$MDATE/$i | $TAR -xvO | mysql --user="$dbuser" --password="$dbpassword" --da tabase=$rdb
echo -en "All restore jobs done!\nDatabase $2 restored to date $3!\n"
Add also this in variables section:
BZIP2=`which bzip2` # name and location of bzip2
And the back-res.sh witl start to import databases.
I would like to thank you Vrij because I was having problems to fix that importing feature and he saved me. Thanks!