Thanks a lot.

----- Original Message -----
From: "Augusto Cesar Castoldi" <[EMAIL PROTECTED]>
To: "Alex Sofronie" <[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 6:22 PM
Subject: Re: [PHP] MySQL Database backup


> Alex,
>
> i'm using the crontab of linux to run a php script:
>
> in crontab: "wget -q
> http://localhost/backup/backup.php.
>
> This script uses the MyPHPAdmin
> (http://phpwizard.net/projects/phpMyAdmin/) dump, he
> "fopen" the php script of MyAdmin (tbl_dump.php) and
> write to a file the "result". This is the script
>
> ------------------------------------------------
> function backup($url, $file)
> {
>   if (file_exists($file))
>     unlink($file);
>   if ($fd = fopen($url, "r"))
>   {
>     $aux = fread($fd, 10000000);
>     fclose($fd);
>     $fd = fopen($file, "aw" );
>     fwrite($fd, $aux);
>     fclose($fd);
>   } else {
>     $fd = fopen("logs.txt", "aw");
>     fwrite($fd, "\n\nErro na URL: $url\n\n");
>     fclose($fd);
>   }
> }
> $file = "fiesc.sql";
> $url =
>
"http://$vendaval/libs/phpadmin2/tbl_dump.php?drop=1&showcolumns=yes&use_bac
kquotes=1&what=data&server=1&lang=pt-br&db=fiesc";
> backup($url, $file);
> --------------------------------------------------
>
> see you,
>
> Augusto
>
>
>
>
>  --- Alex Sofronie <[EMAIL PROTECTED]> escreveu: > I
> tried find a solution to backup a mysql database
> > using php but i didn't
> > find anything but the binary file transfer solution
> > (just open and binary
> > copy all the files in my database directory). But
> > this is not a desired
> > solution because it involves some security holes
> > that I cannot afford.
> > Can anyone tell me where can i learn more about
> > this? Or some simple :) and
> > security holes free solution?
> >
> > Thanks all.
> > Alex Sofronie
> > [EMAIL PROTECTED]
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
____________________________________________________________________________
___________________
> Yahoo! GeoCities
> Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo!
GeoCities. É fácil e grátis!
> http://br.geocities.yahoo.com/
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to