saveset_summary_mod module

Provides a class and related functions for operating on savesets.

class saveset_summary_mod.Saveset_summary(directory, canonical_hostname, backup_id=None, subset=None, init_savedir=False)[source]

Bases: object

A class for summaries - both new and existing.

checkpoint_interval_elapsed()[source]

Return True iff it has been 10 minutes since we last checkpointed.

close()[source]

Close the saveset.

get_backup_id()[source]

Create a backup id from this Saveset.

update(number_of_files=None, finished=False)[source]

Update the backup_id file content.

saveset_summary_mod.backup_id_present(saveset_summary, saveset_summary_list)[source]

Return True if saveset_summary’s backup id is present in saveset_summary_list.

saveset_summary_mod.canonicalize_hostname(user_hostname=None)[source]

Return the current machine’s hostname - canonicalized.

saveset_summary_mod.create_dir_if_needed(init_savedir)[source]

Create the savesets directory if its needed.

saveset_summary_mod.decimal_round(decimal_value, hundredths=Decimal('0.01'))[source]

Round a decimal value to 2 places after the decimal point.

saveset_summary_mod.get_all_saveset_summaries(save_directory, canonical_hostname, last_n=None)[source]

Get all the savesets, creating one Saveset object for each.

saveset_summary_mod.get_hostname_subset_matches(all_savesets_list, canonical_hostname, subset)[source]

Get a list of saveset summaries that match on the hostname and subset.

saveset_summary_mod.get_tweaked_matches(current_saveset_summary, hostname_subset_match_savesets)[source]

Now exclude the current saveset, because doing a save relative to itself makes no sense.

saveset_summary_mod.pick_saveset_summaries(save_directory, canonical_hostname, subset, current_saveset_summary)[source]

Pick up to 3 savesets against which to perform an incremental.

saveset_summary_mod.random_hex_digit()[source]

Return a single, random hex digit.

saveset_summary_mod.random_string(length=16)[source]

Return a hexadecimal string of length length.