[ic] exporting all tables for backup

brian at vermonster.com brian at vermonster.com
Sun Mar 13 15:33:29 EST 2005

Quoting Mark Weaver <mdw1982 at mdw1982.com>:

> Grant wrote:
> > Is there a better way than this to export all tables so their data can
> > be backed up with the rest of the catalog:
> >
> > [loop list="products userdb etc"]
> >         [export table="[loop-code]"]
> > [/loop]
> >
> > - Grant
> Grant,
> Are we talking a manual or automated backup? If you're doing manual
> backups of your interchange data tables then MySQL Administrator works
> wonderful for this; puts everything including the SQL needed for restore
> along with all the data into on handy file that takes seconds to restore.
> If you're talking about an automated process you may want to take a look
> at assigning this duty to a perl program that will accomplish basically
> the same thing; a PERL program connected to a cron job.

You may not need to write a perl script if you are using MySQL.  Just use the
mysqldump program found in most MySQL distributions.  You could add something
like this to your crontab:

0 3 * * * mysqldump --user=user --password=password interchange_database >

Or a simple bash wrapper script that rotates the destination file.

(Check mysqldump --help or http://dev.mysql.com/doc/mysql/en/mysqldump.html for
more options)

- Brian

More information about the interchange-users mailing list