On 15-Mar-01 Gunnar von Boehn wrote:
> 
> Hi
> 
> I run a database using mysql 2.23 by a webspace provider.
> I would like to keep a 1to1 mirror of it at home.
> 
> Unluckiely I have no shell/ftp access to the tables directory. 

I assume you have ftp access to a dump directory ?

> The database-dump (with php) is far too big to download it every day. 

of course you'll have to get the data reasonably up-to-date first ...


add a ts timestamp() column, then run your php script:
$args=' -t "-wts>=current_date" ';
$cmd="/usr/path/to/mysqldump $args $dbname $tblname >$tblname.dmp';

system($cmd);

this will dump just the changes for the day (run it before midnite).
the ftp the tbl.dmp
and run sed 's/INSERT /REPLACE /' tbl.dmp | mysql db
this will get you back insync for the day.

> 
> 
> - Any ideas how to backup it?
> 
> - I'm dreaming of the changing records on the website and at the
>   mirror at home and then magically syncronising the database.

another solution (in case you miss midnite) would be a column
archive enum('N','P','A') not null default 'n' # No, Progress, Archived

just before the dump :
    "update $tblname set archive='P' where archive='N'";

$args=" -t \"-warchive='P'\" ";
$cmd="/usr/path/to/mysqldump $args $dbname $tblname >$tblname.dmp';
system($cmd);

then run "update $tblname set archive='A' where archive='P'";


Regards,
-- 
Don Read                                         [EMAIL PROTECTED]
-- If you are going to sin, sin against God, not the bureaucracy. 
                  God will forgive you but the bureaucrats won't. 

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to