Cron related functions
Disable cron job
Enable cron job
Database classes that facilitate in storing/restoring python content in a form of dictionaries or lists on/from the hard drive. Make sure to provide plain data, no objects, classes or anything that might be hard to convert to a string
Bases: vmware_backup.database._DatabaseDictBase
DatabaseDict class
Bases: vmware_backup.database._DatabaseListBase
DatabaseList class
Bases: vmware_backup.database._DatabaseDictBase
DatabaseOrderedDict class
Collection of decorators to make our life a little easier Based on a recipe from here: https://wiki.python.org/moin/PythonDecoratorLibrary
Decorator to perform multiple attempts
This decorator can be used to turn simple functions into well-behaved decorators, so long as the decorators are fairly simple. If a decorator expects a function and returns a function (no descriptors), and if it doesn’t modify function attributes or docstring, then it is eligible to use this. Simply apply @simple_decorator to your decorator and it will automatically preserve the docstring and function attributes of functions to which it is applied.
Default Backup Settings
Collection of functions that help perform file system tasks such as moving, copying, removing files and folders.
Permissions won’t work on windows os. Only linux based systems
Return free space in bytes Taken from here, slightly modified: http://stackoverflow.com/questions/51658/cross-platform-space-remaining-on-volume-using-python
Taken from here http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python
Creating directory
Creating empty file
Pickle file
Taken from here http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python
Unpickle file
VMWare Backup Logger Class Logs backup process
OrderedDict Class with insert_after and insert_before methods Reference links: 1. http://code.activestate.com/recipes/576693/ 2. https://gist.github.com/jaredks/6276032
Bases: dict
Dictionary that remembers insertion order
and values equal to v (which defaults to None).
od.iteritems -> an iterator over the (key, value) items in od
od.itervalues -> an iterator over the values in od
If key is not found, d is returned if given, otherwise KeyError is raised.
Pairs are returned in LIFO order if last is true or FIFO order if false.
If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v
Virtual Machine Class
Bases: object
Virtual Machine class
Execute backup of this virtual machine
Resuming Virtual Machine
Tells if Virtual Machine is currently running
Suspending Virtual Machine
Backup Machines
VMWare Backup Internals
Some References that might of been used (or not) VMWare Command Line https://www.vmware.com/support/ws5/doc/ws_learning_cli_vmrun.html
Linux Scheduler: http://stackoverflow.com/questions/1603109/how-to-make-a-python-script-run-like-a-service-or-daemon-in-linux http://unix.stackexchange.com/questions/69098/how-can-i-schedule-a-python-program-to-run-from-another-python-program
Windows Scheduler (not supported): http://stackoverflow.com/questions/2725754/schedule-python-script-windows-7
Linux Daemon (not needed?): http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/