I've been asked to look at how to accomplish - as part of a scripted backup - snapshots, taken at regular intervals through the day.
It's a defined number - up to 6 per day.
What I'm wanting to do, is automate the rotation process - such that I can do a recreate and activate on the 'oldest' snap.
I've been thinking in terms of using the XML output of 'synmsnap list - multi' and parsing that, as I have found a reference
"The multi-BCVs (-multi) option directs the query operation to display all BCVs
paired with the standard device; -multi lists BCV devices in chronological order."
Which got me to wondering.
It looks like - if I set up an appropriate device group - if I just do:
symsnap -g recreate
(and then an activate) it recreates the oldest snap each time.
Hence my query - if this is so, it makes my life a LOT easier, as I don't then have to script querying the 'symsnap' info, then extracting from the symdev show, the time of the last snap operation, and then use that information to control this operation.
It would make a lot of sense if it _were_ designed that way, but ... well, it'd be similarly useful to pin down if that is indeed 'by design' or if I've just been lucky for some other reason (such as sequence of device associations, or ... well, whatever).
Plan B involves use of Perl, XML::Twig, and parsing the output - of symapi commands in XML.
It'll work - I'm pretty confident of that (I can already extract and list 'assoicated' snap sessions, and their create dates with a script, and thatll be useful I think, anyway, since it'll let me see what's going on) - but it's a bit more brute force than I like, if this mechanism is already designed into Solutions Enabler.
(and before anyone suggests it, Replication manager is sadly not an option)
EdRolison
9 Posts
434
0
Posted June 21st, 2011 07:00
I thought I'd update with progress so far - I think I've managed to pull together a solution.
Unfortunately I was barking up the wrong tree initially.
But what I've done now, is - using XML::Twig - pull together a script that picks out the sessions listed in a symsnap query -multi -XML
Process it, recreate the 'oldest' VDEVs, and then activate them (consistently).
I've not posted the detail of how that's done here, as it's ... rather verbose perl.
If anyone's interested, I'll do so though.