Skip to Content.
Sympa Menu

en - Re: [sympa-users] Script to back up sympa mysql database

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Cefiar <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-users] Script to back up sympa mysql database
  • Date: Wed, 07 Jan 2009 12:19:08 +1100

address@concealed wrote:
Does anyone have suggestions on how to back up the sympa mysql database?

The automysqlbackup backup script looks like an easy choice.

http://sourceforge.net/projects/automysqlbackup/
With instructions on usage at:
http://www.debianhelp.co.uk/mysqlscript.htm

It basically uses the syntax 'mysqldump > backupfile.sql' but takes care of
all the compression, rotation, and e-mailing logs.

For backing up the sympa folders, it looks like we just need to do a tar of
the
sympa home folder (either /home/sympa or /var/lib/sympa) and the sympa mail
spool folder (/var/spool/mail/sympa )

Note that rsnapshot is a very useful tool for this sort of thing, especially if you have enough disk space.

rsnapshot will either copy files (using rsync) from local or remote directories, or can run scripts. The scripts are expected to dump their data in the current directory, and in my case I dimply have a script that invokes mysqldump for each DB I want backed up.

As an added bonus, when using the rsync part, if you are using a filesystem that supports hardlinks (eg: ext3) then only ONE copy of the file will be kept, as long as it hasn't changed. This is also self-correcting (unlike incremental backups) where if the old 'snapshot' copy gets corrupted on-disk, it WILL create a new copy when backed up as it WILL be different from the corrupted copy.

Also note that where possible I suggest that ANY mysqldump you perform uses --complete-insert (-c) in it's command line, even though it produces bigger dumps. The reasoning for this is that you can simply extract a portion of your dump using standard text editing tools and reinsert it without worry caused by fields being created in the new database in the incorrect order to the dump, which makes correcting a few lost records a simple job. This also makes it MUCH easier to debug any problems you may have on re-creation/importing as well.

--
Stuart Young - aka Cefiar - address@concealed





Archive powered by MHonArc 2.6.19+.

Top of Page