duplicity.statistics module

Generate and process backup statistics

class duplicity.statistics.StatsDeltaProcess[source]

Bases: duplicity.statistics.StatsObj

Keep track of statistics during DirDelta process

add_changed_file(path)[source]

Add stats of file that has changed since last backup

add_deleted_file(path)[source]

Add stats of file no longer in source directory

add_delta_entries_file(path, action_type)[source]
add_new_file(path)[source]

Add stats of new file path to statistics

add_unchanged_file(path)[source]

Add stats of file that hasn’t changed since last backup

close()[source]

End collection of data, set EndTime

get_delta_entries_file()[source]
exception duplicity.statistics.StatsException[source]

Bases: exceptions.Exception

class duplicity.statistics.StatsObj[source]

Contains various statistics, provide string conversion functions

byte_abbrev_list = ((1099511627776, 'TB'), (1073741824, 'GB'), (1048576, 'MB'), (1024, 'KB'))
get_byte_summary_string(byte_count)[source]

Turn byte count into human readable string like “7.23GB”

get_filestats_string()[source]

Return portion of statistics string about files and bytes

get_miscstats_string()[source]

Return portion of extended stat string about misc attributes

get_stat(attribute)[source]

Get a statistic

get_stats_line(index, use_repr=1)[source]

Return one line abbreviated version of full stats string

get_stats_logstring(title)[source]

Like get_stats_string, but add header and footer

get_stats_string()[source]

Return extended string printing out statistics

get_statsobj_copy()[source]

Return new StatsObj object with same stats as self

get_timestats_string()[source]

Return portion of statistics string dealing with time

get_total_dest_size_change()[source]

Return total destination size change

This represents the total increase in the size of the duplicity destination directory, or None if not available.

increment_stat(attr)[source]

Add 1 to value of attribute

read_stats_from_path(path)[source]

Set statistics from path, return self for convenience

set_stat(attr, value)[source]

Set attribute to given value

set_stats_from_line(line)[source]

Set statistics from given line

set_stats_from_string(s)[source]

Initialize attributes from string, return self for convenience

set_to_average(statobj_list)[source]

Set self’s attributes to average of those in statobj_list

space_regex = <_sre.SRE_Pattern object>
stat_attrs = ('Filename', 'StartTime', 'EndTime', 'ElapsedTime', 'Errors', 'TotalDestinationSizeChange', 'SourceFiles', 'SourceFileSize', 'NewFiles', 'NewFileSize', 'DeletedFiles', 'ChangedFiles', 'ChangedFileSize', 'ChangedDeltaSize', 'DeltaEntries', 'RawDeltaSize')
stat_file_attrs = ('SourceFiles', 'SourceFileSize', 'NewFiles', 'NewFileSize', 'DeletedFiles', 'ChangedFiles', 'ChangedFileSize', 'ChangedDeltaSize', 'DeltaEntries', 'RawDeltaSize')
stat_file_pairs = (('SourceFiles', False), ('SourceFileSize', True), ('NewFiles', False), ('NewFileSize', True), ('DeletedFiles', False), ('ChangedFiles', False), ('ChangedFileSize', True), ('ChangedDeltaSize', True), ('DeltaEntries', False), ('RawDeltaSize', True))
stat_misc_attrs = ('Errors', 'TotalDestinationSizeChange')
stat_time_attrs = ('StartTime', 'EndTime', 'ElapsedTime')
stats_equal(s)[source]

Return true if s has same statistics as self

write_stats_to_path(path)[source]

Write statistics string to given path