Re: MySQL partial backup

Ramin K <[email protected]>
Newsgroups gmane.org.user-groups.luni.tech
Message-ID <[email protected]>
On 12/5/2010 9:52 PM, Larry Garfield wrote:
> Maybe I wasn't clear enough.  I want a structural backup only on about a half-
> dozen tables.  I want a complete dump on the rest of them.  It's just the
> cache tables and such that I see no reason to bother backing up the data for
> (but do want structure).  That's the part I'm having trouble with.
>

mysqldump -u $dbadmin -p $dbname $table1 $table2 $table4 $table7 | gzip 
 > $dbname_data_$date.sql.gz

mysqldump -u $dbadmin -p -d $dbname | gzip > $dbname_schema_$date.sql.gz

You'll have to maintain the list of tables on your own of course. And to 
restore you'd need to load the schema first, then data. Or you could 
maintain the tables for your -d mysqldump as well.

Ramin
-- 
Linux Users Of Northern Illinois (Chicago) - Technical Discussion 
http://luni.org/mailman/listinfo/luni
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.