I was messing around with learning how to run mysql a few weeks ago, but
have been very busy with work and haven’t had a chance to go back to it,
so I don’t really remember what I did.
In any case, I use storebackup (from the repositories), and I have it
running a daily backup. I had not really been checking, but I noticed
today that it had not been performing the backup, and had been giving me
an error. There was mail in my inbox that said the following:
running daily cronjob scripts
SCRIPT: output (stdout && stderr) follows
error: skipping "/var/log/mysql/mysqld.log" because parent directory has
insecure permissions (It's world writable or writable by group which is
not "root") Set "su" directive in config file to tell logrotate which
user/group should be used for rotation.
SCRIPT: logrotate
------- END OF OUTPUT
SCRIPT: storebackup exited with RETURNCODE = 1.
SCRIPT: output (stdout && stderr) follows
Error running backup for "/etc/storebackup.d/stbu.conf"
SCRIPT: storebackup
------- END OF OUTPUT
So, I looked up the permissions of this file, and here is what I found:
# ls -l /var/log/mysql/
total 24
-rw-r----- 1 mysql mysql 15900 Oct 2 13:15 mysqld.log
-rw-r----- 1 mysql mysql 1843 Oct 2 13:15 mysqld-upgrade.log
-rw-r----- 1 mysql mysql 2404 Oct 2 13:15 mysqld-upgrade-run.log
somehow when I started trying to learn mysql, these files were created
with the user ‘mysql’.
And then, here is what the storebackup log said:
BEGIN 2013.10.02 14:00:04 16638 backing up directory <> to
</mnt/backcron/default>
VERSION 2013.10.02 14:00:04 16638 storeBackup.pl, 3.2, build 361
INFO 2013.10.02 14:00:04 16638 setting ARG_MAX to 63488 (Linux)
ERROR 2013.10.02 14:00:04 16638 source directory <> does not exist
ERROR 2013.10.02 14:00:04 16638 caught signal 1, terminating
So you can see I am not making backups at the moment (my last backup is
over a month old).
I looked in the /etc/storebackup.d/stbu.conf file to find the “su”
directive, but I can’t figure out where I could or should do that.
So what is the best solution? I see 3 options:
1 - figure out how to tell storebackup to backup this file, but without
changing the owner and user of the mysql files (I don’t even know if
that is possible)
2 - change the owner and user of the mysql files (is that possible?)
3 - tell storebackup to skip those files (I can’t find how to do that,
but doesn’t that defeat the purpose of backing up everything?)
If there are other options, I would definitely appreciate the help.
G.O.
Box #1: 12.3 | KDE 4.10 | AMD Phenom IIX4 | 64 | 16GB
Box #2: 12.2 | KDE 4.9.2 | AMD Athlon X3 | 64 | 4GB
Laptop: 12.3 | KDE 4.10 | Core i7-2620M | 64 | 8GB