Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.