Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]

share|improve this question

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.

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

You must log in to answer this question.

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