0

In rsnapshot's config file I added /var/lib/mysql/ as another source directory to back up.

But rsnapshot does not back it up. Why?

/var/log/rsnapshot does not list a relevant warning.

The owner of /var/lib/mysql/ is mysql/mysql . I am not a member of the group »mysql«.

[Ubuntu 12.04, GNOME Shell 3.4]

1 Answer 1

0

Look at the permissions: ls -ld /var/lib/mysql. You most probably don't have read access to the raw tables as a regular user. This is by design: these directories include sensitive user data.

You should either run the backup as root, and/or even better: use a database dumper scheme such as automysqlbackup or make your own with e.g. mysqldump and a small script.

It is not recommended to back up the raw data directories themselves, since it can be problems if you back up while a transaction is happening, and other risks of corrupt backups and subsequent restore issues. The way to do it is to ask the MySQL server to dump the data for you in a chosen, easily restorable format.

3
  • Daniel Andersson wrote: "You most probably don't have read access to the raw tables as a regular user."
    – bullgard4
    May 22, 2012 at 10:05
  • I found out that AutoMySQLBackup is available as a DEB program package from Ubuntu repositories.
    – bullgard4
    May 22, 2012 at 11:04
  • @bullgard4: Yes, I use it in Debian. It's very simple, but seems to do its task well. May 22, 2012 at 11:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .