Backup XenServer VMs
OK, so I've been using Andy Burton's fantastic XenServer VM backup script (Clickety) and the only fault I can find is not script based but XenServer. If you try and overwrite an already existing backed up VM, XenServer seems to ignore that.
So, I decided to tackle the situation by doing the following:
Grab a list of the files that already exist and serializing that list
Perform the actual VM backups
Delete the original files that are in the serialized file
Delete the serialized file itself
And I'm trying to improve my python-fu so I decided to do this (1,3 and 4) with python scripts and still do the backup with Andy's, possibly moving to my own python script in the future.
Now I have a pair of scripts, prebak.py and postbak.py as follows:
My two questions:
How can I serialize and deserialize the values I retrieve from glob in list format?
Is there a better way of doing this?
This is being run on Python 2.4.3 (the version I found on XenServer 5.x)
Oh yeah, I also thought of doing some smart redirections along the lines of:
redirect the contents of the files to a "xargs rm" but I wasn't too sure how to do that.
|All times are GMT -5. The time now is 03:51 PM.|