Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had created a script that uses rsync to backup some directories of the production servers to a dedicated one. I would also like to perform a backup of the directory /var/lib/mysql/some_database.

As cron task that executes the backup is associated to a user different than root, I need to set some permissios on the /var/lib/mysql/ directory.

As far as I know, it is only needed that the user can navigate (execute) through the some_database/ directory and the files that are placed inside it, have read permissions.

Which are the more proper permissions that I should use?

Thanks in advance for the help, Best regards!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

doing a backup of /var/lib/mysql is not a good idea, because the mysql daemon needs to be stopped before.

use tools like mysqldump to dump the databases into a file in e.g. /var/backups/mysql/ or whereever and backup these files

the dump of the databases can be started by the user creating the backup, so there will be no problems. but think of removing rights on the folder for group and world if you do not need them

share|improve this answer
    
Hi! The backup is done by night, when is certainly sure that the system is not being used. So, if I add instructions to stop the mysql daemon before the database is copied and then start the daemon again, will be a acceptable approach? Thanks for the help, Best regards! –  Rui Gonçalves Jul 29 '10 at 9:55
    
@ruigoncalves: You could do a manual backup, but a MySQL-dump would be better. –  Josh Aug 31 '10 at 13:05
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.