On 2010-04-08 osmcr...@gmail.com wrote:
> I'm running Suse 10.3 Server and looking for a script like this that
> will backup all the system config files and any others that I would
> want, this is a db and mailbox users backup for my mail server ?..
> But I plan migrating to a new server, using the same distro that's why
> I'm preparing it for restore again in case of emergency
> 
> Any comments are welcome
[...]
>         cp -Rp /var/lib/mysql/* /media/backups/db/db_$DATE
>         cp -Rp /var/lib/imap/* /media/backups/db/db-imap_$DATE
>         cp -Rp /var/spool/imap/user/* /media/backups/users/users_$DATE

Unless you stopped the respective daemons beforehand, these are likely
to leave you with inconsistent databases after a restore. Either stop
the respective services for the time of the backup, or use the
appropriate export tools (e.g. mysqldump for MySQL). You can't simply
copy the files of a running database.

Also I'd suggest to use "rsync -a" instead of "cp -Rp" for performing
file backups.

Regards
Ansgar Wiechers
-- 
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky

Reply via email to