[ic] exporting all tables for backup

Mark Weaver mdw1982 at mdw1982.com
Tue Mar 15 23:27:56 EST 2005


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 >
>>/path/to/backup.sql
>>
>>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
> 
> 
> Thanks guys, that sounds pretty slick but IC already has a
> dumper/exporter built in right?  Using that makes it easy to backup
> the database data along with the catalog files.  I suppose something
> like mysqldump would be just about as simple.
> 
> - Grant

Grant,

you could actually do both from a cron job which would be the best 
solution since you wouldn't have to do this manually. To back up the 
catalog files simply include this in the interchange users cron tab or 
the root user's cron tab.

	tar -zcf /home/interch/catalogs interch_cat.tgz

-- 
Mark
-----------------------------------------------------------
Paid for by Penguins against modern appliances(R)
Linux User Since 1996
Powered by Mandrake Linux 8.2, 10.0 & RH Fedora Core 3


More information about the interchange-users mailing list