View Single Post
Old 17th May 2011, 19:15
erosbk erosbk is offline
Senior Member
Join Date: Mar 2011
Posts: 337
Thanks: 49
Thanked 36 Times in 30 Posts


I have a problem with this line... all is working ok but... in this line I get an error when trying to restore...

		mysql -u$dbuser -p$dbpassword $rdb < $TAR -xvjp $BACKUPDIR/$YDATE-$MDATE/$i
the $TAR variable is ok (echo $TAR shows its value), but, if I run:

echo mysql -u$dbuser -p$dbpassword $rdb < $TAR -xvjp $BACKUPDIR/$YDATE-$MDATE/$i

I get: mysql -uuser -ppassword notremember < -xvjp /mibackupdir/date/blabla

It is like mysql were eating the value of $TAR!!!

I write ANOTHER $TAR in the sentence... (... < $TAR $TAR ... ) and the echo shows it correctly:

mysql -uuser -ppassword notremember < /TARPATH -xvjp /mibackupdir/date/blabla

but I get an error =(

I am using Debian, using bash as shell... could you help me? I think that a work around could to untar in a tmp directory, and next do the dump... (this workaround would be great... I didn't have time to modify it...)

Thanks for this perfect and usefull script.
Reply With Quote