Re: mysqldump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason,

I tried the double quotes but that didn't seem to matter.  I also put the 
command string in a variable and then am running the variable with exec. 
Still it doesnt work.

$filename = "/home/virtual/site341/fst/var/www/html/db_backup_" . 
date("n-j-y").".sql";
$command = "/home/virtual/site341/fst/usr/bin/mysqldump -u ***** -p***** 
database > $filename";
echo $command;
exec($command);

Thanks for your post,

Aaron


"Jason Wong" <php-db@xxxxxxxxxxxx> wrote in message 
news:200411100231.47818.php-db@xxxxxxxxxxxxxxx
> On Tuesday 09 November 2004 17:59, Aaron Todd wrote:
>> I have created a PHP script that looks like:
>>
>> <?php
>>   $filename = "/var/www/html/db_backup_" . date("n-j-y").".sql";
>>   exec('mysqldump -u ***** -p***** database > $filename');
>> ?>
>>
>> For some reason this doesnt work and I cant figure out why.  There is no
>> error that comes back.  When I run the mysqldump command from the server
>> console it produces the file fine.  I have read a few other posts out 
>> there
>> about this same thing which resulted in the location the file was being
>> saved.  But I have gone through my server and found nothing.  Does anyone
>> have any suggestions for regarding this.
>
> Try using double quotes.
>
> Also just like performing SQL queries, it's a very good idea to build up 
> the
> command you want executed, store it in a string ($cmd), then echo it to 
> see
> whether it looks good, then exec($cmd).
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-db
> ------------------------------------------
> /*
> Save the bales!
> */ 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux