Hi Gary
Are you running rdiff-backup as root? Even if you are, backing up
mysql databases needs some extra work to ensure that you get a
consistent backup. For my linux machines I have mysql databases (and
all my data) on LVM
volumes, so I briefly lock the mysql server, take a snapshot of the
volume (which happens quickly) and unlock the mysql server, and then
I can take a backup from the snapshot:
# ... simplified code clip ...
MYVG="myvg" # name of LVM volume group
MYLV="mylv" # name of LVM logical volume
# lock mysql, create snapshot, unlock mysql
mysql --execute="FLUSH TABLES WITH READ LOCK;"
lvcreate -L528M -s -n "$MYLV-snap" "/dev/$MYVG/$MYLV"
mysql --execute="UNLOCK TABLES;"
# mount snapshot
mkdir -p "/mnt/$MYLV-snap"
mount "/dev/$MYVG/$MYLV-snap" "/mnt/$MYLV-snap"
# backup $MYLV-snap
rdiff-backup "/mnt/$MYLV-snap" ...
# unmount and delete snapshot
umount "/mnt/$MYLV-snap"
rm -r "/mnt/$MYLV-snap"
lvremove -f "/dev/$MYVG/$MYLV-snap"
Without LVM you can't use snapshots, but you could lock the mysql
databases and then run rdiff-backup and unlock afterwards. But the
mysql databases would remain locked while the rdiff-backup operation
is running - which may not be ideal.
If you google 'rdiff-backup mysql' you will see a few other possible
ways to backup mysql databases (e.g. using mysqldump).
BTW, I find it very strange that no Linux filesystems have built-in
stable snapshot support except by putting them on top of LVM, which
is usually a bespoke configuration - Windows has the advantage here.
Dominic
On 06/11/2012 14:26, Gary Rickert
wrote:
Hello again Dominic,
One more quick (I hope) question you may have an idea of how to
resolve. I am trying to rdiff- the mysql .ibd's, and I get a
permissions error. I have tried adding my rdiff user to the mysql
group, and was already in sudo, but that did not resolve. The
error I am receiving follows:
Exception '[Errno 13] Permission denied:
'/var/lib/mysql/PFA_production/*.ibd'' raised of class
'exceptions.OSError':
File "/usr/lib64/python2.4/site-packages/rdiff_backup/Main.py",
line 304, in error_check_Main
try: Main(arglist)
File "/usr/lib64/python2.4/site-packages/rdiff_backup/Main.py",
line 321, in Main
rps = map(SetConnections.cmdpair2rp, cmdpairs)
File
"/usr/lib64/python2.4/site-packages/rdiff_backup/SetConnections.py",
line 78, in cmdpair2rp
return rpath.RPath(conn, filename).normalize()
File "/usr/lib64/python2.4/site-packages/rdiff_backup/rpath.py",
line 884, in __init__
else: self.setdata()
File "/usr/lib64/python2.4/site-packages/rdiff_backup/rpath.py",
line 908, in setdata
self.data = "">
File
"/usr/lib64/python2.4/site-packages/rdiff_backup/connection.py",
line 450, in __call__
return apply(self.connection.reval, (self.name,) + args)
File
"/usr/lib64/python2.4/site-packages/rdiff_backup/connection.py",
line 370, in reval
if isinstance(result, Exception): raise result
Traceback (most recent call last):
File "/usr/bin/rdiff-backup", line 30, in ?
rdiff_backup.Main.error_check_Main(sys.argv[1:])
File "/usr/lib64/python2.4/site-packages/rdiff_backup/Main.py",
line 304, in error_check_Main
try: Main(arglist)
File "/usr/lib64/python2.4/site-packages/rdiff_backup/Main.py",
line 321, in Main
rps = map(SetConnections.cmdpair2rp, cmdpairs)
File
"/usr/lib64/python2.4/site-packages/rdiff_backup/SetConnections.py",
line 78, in cmdpair2rp
return rpath.RPath(conn, filename).normalize()
File "/usr/lib64/python2.4/site-packages/rdiff_backup/rpath.py",
line 884, in __init__
else: self.setdata()
File "/usr/lib64/python2.4/site-packages/rdiff_backup/rpath.py",
line 908, in setdata
self.data = "">
File
"/usr/lib64/python2.4/site-packages/rdiff_backup/connection.py",
line 450, in __call__
return apply(self.connection.reval, (self.name,) + args)
File
"/usr/lib64/python2.4/site-packages/rdiff_backup/connection.py",
line 370, in reval
if isinstance(result, Exception): raise result
OSError: [Errno 13] Permission denied:
'/var/lib/mysql/PFA_production/*.ibd'
Fatal Error: Lost connection to the remote system
On Fri, Nov 2, 2012 at 10:48 AM, Dominic
Raferd <address@hidden>
wrote:
Well Gary I'm glad you
succeeded in the end, and pleased to be of service.
Yes normally the build location is /usr/src (absolute
location) but you seemed to be using ./usr/src that is why I
suggested you stick with that. If it has worked for you with
/usr/src then that's better IMHO.
I have now uploaded my rdiff-backup installer program
rdiff-backup-install.sh to the web - help and download page
at http://www.timedicer.co.uk/programs/help/rdiff-backup-install.sh.
I've tweaked and renumbered it v0.3. If you use it again
please use the latest version from there just so that I can
check it is bug-free.
Now that you have rdiff-backup working you might want to
install rdiffweb which provides a web interface for
retrieving files from the rdiff-backup server; install
program is at http://www.timedicer.co.uk/programs/help/rdiffweb-install.sh.
Regards, Dominic
--
TimeDicer:
Free File Recovery from Whenever
On 02/11/2012 13:50, Gary Rickert wrote:
Well Dominic, I sure hope you have had as
much fun as I have:)
All kidding aside, it looks like this script did it. I
installed on my backup system, ran and got the version
mis-match message, as expected. Ran
rdiff-backup-install.sh on my other system, ran and all
again looks OK. Thank you, thank you.
So, what was the challenge?
I will be doing a bunch more testing/bench-marking again
in a few days, but I have some catching up to do after
spending most of the last week emersed in this. I
haven't looked in detail at the following install
output, or tried to figure out the install script, but I
believe the destination address in the install command
line (/usr/src) should be absolute, not relative. y/n?
My hope is that you don't hear from me again, but hope I
haven't worn out my welcome if I do have more issues. It
is not often that I see this level of responsiveness,
even from paid vendors.
Thanks again
Gary
**********************************************************
root ~/install#./rdiff-backup-install.sh 1.2.8 /usr/src
rdiff-backup-install.sh v0.2 [02 Nov 12] by Dominic (-h
for help)
=======================
Searching for librsync.so*: /usr/lib
Searching for Python.h: /usr/include/python2.4/Python.h
Download rdiff-backup-1.2.8.tar.gz [y/-]: y
Untar the rdiff-backup-1.2.8.tar.gz
[y/-]: Build the downloaded program [y/-]: y
running build
**************************************************************
On Fri, Nov 2, 2012 at 3:30 AM, Dominic
Raferd <address@hidden>
wrote:
Here is a
further-improved version of my script, and hopefully
it can now use yum to install any missing
dependencies. Notice that its name has changed to
rdiff-backup-install.sh (i.e. with '.sh' added at
the end). Try this (v0.2) instead of the one I sent
a couple of hours ago.
Dominic
On 02/11/2012 00:50, Gary Rickert
wrote:
I hope "without any
warranties" doesn't mean without
assistance:}
When I run the script I get:
root ~/install/rdiff-backup-1.2.8 #
installrdiff -pnq 1.2.8 /opt
Unable to locate librsync.a. Please
install librsync-dev and try again.
root ~/install/rdiff-backup-1.2.8 #
installrdiff -pnq rdiff-backup-1.2.8 /opt
Unable to locate librsync.a. Please
install librsync-dev and try again.
The first thing I noticed was the package
name installed:
Package librsync-devel-0.9.7-13.el5.x86_64
already installed and latest version
Package librsync-devel-0.9.7-13.el5.i386
already installed and latest version
Name : librsync
Arch : x86_64
Version : 0.9.7
Release : 13.el5
Hope this search may help:
./root/install/rdiff-backup-1.2.8/build/lib.linux-x86_64-2.4/rdiff_backup/librsync.py
./root/install/rdiff-backup-1.2.8/rdiff_backup/librsync.py
./usr/lib64/librsync.so
./usr/lib64/librsync.so.1.0.2
./usr/lib64/librsync.so.1
./usr/share/man/man3/librsync.3.gz
./usr/share/doc/librsync-0.9.7
./usr/include/librsync-config.h
./usr/include/librsync.h
./usr/lib/librsync.so
./usr/lib/librsync.so.1.0.2
./usr/lib/librsync.so.1
./usr/local/lib64/python2.4/site-packages/rdiff_backup/librsync.pyc
./usr/local/lib64/python2.4/site-packages/rdiff_backup/librsync.py
Can't think of anything else that may help
you, but I pray you can help me.
Gary
On Thu, Nov 1,
2012 at 5:14 PM, Dominic Raferd <address@hidden>
wrote:
Oh dear. It looks like some
sort of installation issue,
probably some confusion of
directories.
I attach a script I wrote a little
while ago to auto-install
rdiff-backup 1.2.8. I haven't used
it for a while and it has not I
think been tested under Centos but
it should work. Unzip the
attachment and then run the file
with superuser permissions (i.e.
with sudo if you are not already
root). Use -h option to see the
help first. Don't use the -p
option (the patch it suggests
doesn't really help.)
I'm afraid it comes without any
warranties of course!
Regards
Dominic
On 01/11/12 22:46, Gary Rickert
wrote:
Well Dominic. Hope you are
the patient type. I just broke
it installing 1.2.8.
Name : python Arch : x86_64
Version : 2.en Release :
46.el5_8.2
Name : python-devel Arch :
i386 Version : 2.4.3 Release
: 46.el5_8.2
Name : librsync Arch : i386
Version : 0.9.7 Release :
13.el5
Name : librsync-devel Arch :
x86_64 Version : 0.9.7 Release
: 13.el5
root rdiff-backup-1.2.8 # python setup.py install --prefix=/usr/local
When I try to run it, I get:
Traceback (most recent call
last):
File
"/usr/local/bin/rdiff-backup",
line 20, in ?
import rdiff_backup.Main
ImportError: No module named
rdiff_backup.Main
Things were finally going so
well. What have I done to
myself, and hopefully how do I
fix it.
Gary
On
Wed, Oct 31, 2012 at 9:49
PM, Gary Rickert <address@hidden>
wrote:
Thanks
again Dominic,
What distro are you using?
Centos 5.6
3.0.18-x86_64-linode24
I also don't understand
the path to usr/bin
either, but it will be
needed in the cron script
version anyway.
I always appreciate having
a good understanding of
what I do, which is often
just answered, seldom
explained in the search
results. I usually can
figure out scripts, but
sometimes there are real
challenges.
Thanks for all the help.
Gary
--
TimeDicer: Free
File Recovery from Whenever
|