|
From: <fcr...@us...> - 2011-12-30 08:43:57
|
Revision: 782
http://safekeep.svn.sourceforge.net/safekeep/?rev=782&view=rev
Author: fcrawford
Date: 2011-12-30 08:43:51 +0000 (Fri, 30 Dec 2011)
Log Message:
-----------
Added LVM snapshot LV tagging support as requested by Andres Toomsalu
Modified Paths:
--------------
safekeep/trunk/doc/safekeep.backup.txt
safekeep/trunk/safekeep
Modified: safekeep/trunk/doc/safekeep.backup.txt
===================================================================
--- safekeep/trunk/doc/safekeep.backup.txt 2011-12-25 13:40:47 UTC (rev 781)
+++ safekeep/trunk/doc/safekeep.backup.txt 2011-12-30 08:43:51 UTC (rev 782)
@@ -242,6 +242,12 @@
of the original device's size.
Mandatory for a `<snapshot>` element.
+/backup/setup/snapshot/@tag::
+ A tag to be added to the snapshot, with the `--addtag` argument
+ to `lvcreate`. An `@` is automatically added to the generated
+ tag.
+ Optional for a `<snapshot>` element.
+
/backup/setup/script/@path::
Execute the script specified path on the client at certain steps
of the backup process.
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2011-12-25 13:40:47 UTC (rev 781)
+++ safekeep/trunk/safekeep 2011-12-30 08:43:51 UTC (rev 782)
@@ -328,7 +328,8 @@
size = snap_el.getAttribute('size')
if not size:
raise ConfigException('Please specify the size for the snapshot')
- return { 'device' : device, 'size' : size }
+ tag = snap_el.getAttribute('tag')
+ return { 'device' : device, 'size' : size, 'tag' : tag }
def parse_clude(clude_el):
path = clude_el.getAttribute('path')
@@ -681,8 +682,14 @@
if not snapmnt:
warn('Cannot find the mountpoint for: %s' % device)
continue
- args = ['lvcreate', '--snapshot', '--size', snap['size'],
- '--name', os.path.basename(snapdev), lvmdev]
+ tag = snap['tag']
+ if tag:
+ args = ['lvcreate', '--addtag', '@' + tag,
+ '--snapshot', '--size', snap['size'],
+ '--name', os.path.basename(snapdev), lvmdev]
+ else:
+ args = ['lvcreate', '--snapshot', '--size', snap['size'],
+ '--name', os.path.basename(snapdev), lvmdev]
ec = spawn(args)
if ec:
warn('Can not snapshot the device: %s' % device)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|