[Dirvish] dirvish and an lv snapshot

Jenny Hopkins hopkins.jenny at gmail.com
Wed Jul 14 21:40:06 UTC 2010


Hullo,

I'm having problems with making a backup of an lvm partition on a xen server.
I have a working script that creates an lvm snapshot of the partition
and mounts it. In the dirvish cronjob script I have placed the script
to run before dirvish expire and dirvish runall is called, then the
same script with an unmount parameter is called.
Like this:


## Example of how to mount and umount a backup partition...
# mount_check /backup
lvmsnapshot.sh create scafell

/usr/sbin/dirvish-expire --quiet && /usr/sbin/dirvish-runall --quiet
rc=$?

# umount /backup || rc=$?

lvmsnapshot.sh remove scafell || rc=$?


exit $rc

The problem is that the command to umount and remove the snapshot from
the mount point is run immediately after the dirvish is called, so
that there is no image to backup found.
I sort of assumed that the rc=$?  was to ensure the "lvmsnapshot.sh
remove scafell || rc=$?" wasn't called until after dirvish had done
its thing, but I must be wrong.  I comment out this line and the
backup runs fine.
I could put that line in a separate script and call it from cron a few
hours later but that's kind of messy.

Can anyone offer advice?

Thanks,

Jenny


More information about the Dirvish mailing list