mylvmbackup-discuss team mailing list archive
-
mylvmbackup-discuss team
-
Mailing list archive
-
Message #00045
precleanup problem
Hello,
i have a big problem.
Second time at this week mylvmbackup hook "precleanup" has removed all
content of the server.
This is what i see on screen:
...
backup-pos/backup-20090824_122832_mysql.pos
backup-pos/backup-20090824_122832_mysql_my.cnf
81.6%
20090824 12:28:55 Info: DONE: create tar archive
20090824 12:28:55 Info: Running hook 'precleanup' as perl module.
/bin/rm: cannot remove directory `//usr/home': Device or resource busy
/bin/rm: cannot remove `//proc/scsi/sg/version': Operation not permitted
/bin/rm: cannot remove `//proc/scsi/sg/device_strs': Operation not
permitted
/bin/rm: cannot remove `//proc/scsi/sg/devices': Operation not permitted
/bin/rm: cannot remove `//proc/scsi/sg/device_hdr': Operation not
permitted
/bin/rm: cannot remove `//proc/scsi/sg/def_reserved_size': Operation
not permitted
/bin/rm: cannot remove `//proc/scsi/sg/debug': Operation not permitted
/bin/rm: cannot remove `//proc/scsi/sg/allow_dio': Operation not
permitted
/bin/rm: cannot remove `//proc/scsi/device_info': Operation not
permitted
etc.
My /etc/mylvmbackup.conf is:
#
# mylvmbackup configuration file
#
# Every line beginning with a pound sign (#) will be treated as a
comment.
# Values should be put right after the equals sign, without whitespace.
# Please refer to the mylvmbackup(1) manual page for more information
#
# These values define how mylvmbackup should connect to the local
MySQL server
# Ususally host, port and socket path don't need to be provided, if the
# DBD::MySQL Perl module has been compiled with the same values that
the local
# MySQL server uses. If a non-empty host name other than "localhost" is
# provided, the socket path is ignored.
#
[mysql]
user=root
password=xxx
host=
port=
socket=
mycnf=/etc/my.cnf
#
# LVM-specific options
#
[lvm]
vgname=vol0
lvname=var
backuplv=
lvsize=3G
#
# File system specific options
#
[fs]
xfs=0
mountdir=/var/tmp/mylvmbackup/mnt/
backupdir=/backup/
relpath=/lib/mysql/
#
# Full path names of required external utilities
#
[tools]
lvcreate=/usr/sbin/lvcreate
lvremove=/usr/sbin/lvremove
lvs=/usr/sbin/lvs
mount=/bin/mount
tar=/bin/tar
compress=/bin/gzip
# alternative tar backup compression tools
#compress=/usr/bin/lzma
#compress=/usr/bin/bzip2
# or (for no compression):
#compress=/bin/cat
#
rsync=/usr/bin/rsync
rsnap=/usr/bin/rsnap
umount=/bin/umount
#
# Other configuration options
#
[misc]
backuptype=tar
prefix=backup
suffix=_mysql
tararg=cvf
tarsuffixarg=
tarfilesuffix=.tar.gz
compressarg=--stdout --verbose --best
# for LZMA:
#compressarg=--stdout --verbose -7
# for bzip2:
#compressarg=--stdout --verbose -7
# for cat:
#compressarg= # ie. nothing
rsyncarg=-avWP
rsnaparg=7
datefmt=%Y%m%d_%H%M%S
innodb_recover=0
pidfile=/var/tmp/mylvmbackup_recoverserver.pid
skip_flush_tables=0
extra_flush_tables=0
skip_mycnf=0
hooksdir=/usr/share/mylvmbackup
skip_hooks=0
keep_snapshot=0
quiet=0
#
# Logging options. The Sys::Syslog module is required for syslog option
# See "perldoc Sys::Syslog" for more information.
#
[logging]
# 'console' (STDOUT, STDERR) or 'syslog' or 'both'.
log_method=console
# 'native', 'tcp', 'udp'. Default is 'native'
syslog_socktype=native
syslog_facility=
# If using remote syslog, don't forget to change the socket type to
tcp or udp.
syslog_remotehost=
I think the problem is in the precleanup hook perl package:
while($_ = readdir(DIR))
{
next if /^\.{1,2}$/;
my $path = "$dest/$_";
if(-d $path && int(-M $path) > $retention)
{
if(system("/bin/rm -rf $path") != 0)
{
$errstr .= "Unable to prune $path: $!
\n";
}
}
}
closedir DIR;
Why this hook tries to remove all content of the backup folder
"backupdir=/backup/"? I save another backups in the /backup directory,
not only mylvmbackup, i don't need to remove it.
why it removes all content of the server? I really don't know, but i
have 2 servers with empty / dirs :(
Will "skip_hooks=1" disable hooks at all?
I think using of this hook is a bad practice.
--
Kirill Morozov
KIMO2-RIPE, RHCE
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
Follow ups