input-output redirection problem...
| From: | Christian Dechery | Date: | Mon, 08 Oct 2001 14:12:17 +0000 |
| Subject: | input-output redirection problem... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70360@lists.php.net to get a copy of this message | ||
I'm going crazy with this...
my recent posts (crazy exec(), problems with exec(), etc...) describes my problems... I just solved on right now and I'm half way to the complete solution...
it's a script to backup and restore a mysql database... it's working beautifully on Win2000... but in Win98 it doesn't... after lots of attempts I figured it is the '>' and '<' in the commands...
example of a dump-to-file command:
$cmd="mysqldump -h $host --user=$user --password=\"$pass\" --opt --databases $db > $backupFile";
// this doesn't work... (I don't know why)
$cmd="mysqldump -h $host --user=$user --password=\"$pass\" --opt --databases --result-file=$backupFile $db";
// this works fine... thanks to the --result-file paramater...
now the problem... I can dump the database, I can back it up right? But what about restore?
I have something like:
$cmd="mysql -h $host --user=$user --password=\"$pass\" --database=$db < $backupFile";
// this works just fine in Win200, but because of this little prob in Win98 it doesn't...
so how am I supposed to use 'mysql.exe' to restore a database???
Please help...
_________________________________
. Christian Dechery - CTO
.. WebDeveloper @ Webstyle!
.. http://www.webstyle.com.br
.. http://www.tanamesa.com.br