vmware_backup package

Submodules

vmware_backup.cron module

Cron related functions

vmware_backup.cron.disable_backup(backup_command)

Disable cron job

vmware_backup.cron.enable_backup(settings, backup_command)

Enable cron job

vmware_backup.database module

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

class vmware_backup.database.DatabaseDict(**kwargs)

Bases: vmware_backup.database._DatabaseDictBase

DatabaseDict class

class vmware_backup.database.DatabaseList(**kwargs)

Bases: vmware_backup.database._DatabaseListBase

DatabaseList class

class vmware_backup.database.DatabaseOrderedDict(**kwargs)

Bases: vmware_backup.database._DatabaseDictBase

DatabaseOrderedDict class

vmware_backup.default_settings module

Default Backup Settings

vmware_backup.file_system module

Collection of functions that help perform file system tasks such as moving, copying, removing files and folders.

vmware_backup.file_system.copy_dir(source_path, destination_path)
vmware_backup.file_system.copy_file(source_file, destination_file, permissions=None)

Permissions won’t work on windows os. Only linux based systems

vmware_backup.file_system.create_time_stamp(time_stamp_format)
vmware_backup.file_system.get_free_space(path)

Return free space in bytes Taken from here, slightly modified: http://stackoverflow.com/questions/51658/cross-platform-space-remaining-on-volume-using-python

vmware_backup.file_system.get_size(path)

Taken from here http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python

vmware_backup.file_system.make_dir(dir_path)

Creating directory

vmware_backup.file_system.make_file(file_path)

Creating empty file

vmware_backup.file_system.pickle_file(file_path, data_to_pickle)

Pickle file

vmware_backup.file_system.print_memory_size(size)

Taken from here http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python

vmware_backup.file_system.remove_dir(dir_path)
vmware_backup.file_system.remove_file(file_path)
vmware_backup.file_system.unpickle_file(file_path)

Unpickle file

vmware_backup.logger module

VMWare Backup Logger Class Logs backup process

class vmware_backup.logger.Logger(filename=None)

Bases: object

write(message)

vmware_backup.ordered_dict module

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

class vmware_backup.ordered_dict.OrderedDict(*args, **kwds)

Bases: dict

Dictionary that remembers insertion order

clear() → None. Remove all items from od.
copy() → a shallow copy of od
classmethod fromkeys(S[, v]) → New ordered dictionary with keys from S

and values equal to v (which defaults to None).

insert_after(existing_key, key_value)
insert_before(existing_key, key_value)
items() → list of (key, value) pairs in od
iteritems()

od.iteritems -> an iterator over the (key, value) items in od

iterkeys() → an iterator over the keys in od
itervalues()

od.itervalues -> an iterator over the values in od

keys() → list of keys in od
pop(k[, d]) → v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() → (k, v), return and remove a (key, value) pair.

Pairs are returned in LIFO order if last is true or FIFO order if false.

setdefault(k[, d]) → od.get(k,d), also set od[k]=d if k not in od
update(E, **F) → None. Update od from dict/iterable E and F.

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

values() → list of values in od
viewitems() → a set-like object providing a view on od's items
viewkeys() → a set-like object providing a view on od's keys
viewvalues() → an object providing a view on od's values

vmware_backup.virtual_machine module

Virtual Machine Class

class vmware_backup.virtual_machine.VirtualMachine(settings, vm_path)

Bases: object

Virtual Machine class

backup()
vmware_backup.virtual_machine.execute_backup(settings)

Backup Machines