Package duplicity :: Module collections :: Class CollectionsStatus
[hide private]
[frames] | no frames]

Class CollectionsStatus

source code

Hold information about available chains and sets

Instance Methods [hide private]
 
__init__(self, backend, archive_dir)
Make new object.
source code
 
to_log_info(self)
Return summary of the collection, suitable for printing to log
source code
 
__str__(self)
Return string summary of the collection
source code
 
set_values(self, sig_chain_warning=1)
Set values from archive_dir and backend.
source code
 
set_matched_chain_pair(self, sig_chains, backup_chains)
Set self.matched_chain_pair and self.other_sig/backup_chains
source code
 
warn(self, sig_chain_warning)
Log various error messages if find incomplete/orphaned files
source code
 
get_backup_chains(self, filename_list)
Split given filename_list into chains
source code
 
get_sorted_sets(self, set_list)
Sort set list by end time, return (sorted list, incomplete)
source code
 
get_signature_chains(self, local, filelist=None)
Find chains in archive_dir (if local is true) or backend
source code
 
get_sorted_chains(self, chain_list)
Return chains sorted by end_time.
source code
 
get_backup_chain_at_time(self, time)
Return backup chain covering specified time
source code
 
get_signature_chain_at_time(self, time)
Return signature chain covering specified time
source code
 
get_extraneous(self, extra_clean)
Return list of the names of extraneous duplicity files
source code
 
sort_sets(self, setlist)
Return new list containing same elems of setlist, sorted by time
source code
 
get_chains_older_than(self, t)
Return a list of chains older than time t
source code
 
get_last_full_backup_time(self)
Return the time of the last full backup, or 0 if there is none.
source code
 
get_nth_last_full_backup_time(self, n)
Return the time of the nth to last full backup, or 0 if there is none.
source code
 
get_last_backup_chain(self)
Return the last full backup of the collection, or None if there is no full backup chain.
source code
 
get_nth_last_backup_chain(self, n)
Return the nth-to-last full backup of the collection, or None if there is less than n backup chains.
source code
 
get_older_than(self, t)
Returns a list of backup sets older than the given time t
source code
 
get_older_than_required(self, t)
Returns list of old backup sets required by new sets
source code
Method Details [hide private]

__init__(self, backend, archive_dir)
(Constructor)

source code 

Make new object. Does not set values

set_values(self, sig_chain_warning=1)

source code 

Set values from archive_dir and backend.

Returns self for convenience. If sig_chain_warning is set to None, do not warn about unnecessary sig chains. This is because there may naturally be some unecessary ones after a full backup.

set_matched_chain_pair(self, sig_chains, backup_chains)

source code 

Set self.matched_chain_pair and self.other_sig/backup_chains

The latest matched_chain_pair will be set. If there are both remote and local signature chains capable of matching the latest backup chain, use the local sig chain (it does not need to be downloaded).

get_backup_chains(self, filename_list)

source code 

Split given filename_list into chains

Return value will be tuple (list of chains, list of sets, list of incomplete sets), where the list of sets will comprise sets not fitting into any chain, and the incomplete sets are sets missing files.

get_signature_chains(self, local, filelist=None)

source code 

Find chains in archive_dir (if local is true) or backend

Use filelist if given, otherwise regenerate. Return value is pair (list of chains, list of signature paths not in any chains).

get_sorted_chains(self, chain_list)

source code 

Return chains sorted by end_time. If tie, local goes last

get_backup_chain_at_time(self, time)

source code 

Return backup chain covering specified time

Tries to find the backup chain covering the given time. If there is none, return the earliest chain before, and failing that, the earliest chain.

get_signature_chain_at_time(self, time)

source code 

Return signature chain covering specified time

Tries to find the signature chain covering the given time. If there is none, return the earliest chain before, and failing that, the earliest chain.

get_extraneous(self, extra_clean)

source code 

Return list of the names of extraneous duplicity files

A duplicity file is considered extraneous if it is recognizable as a duplicity file, but isn't part of some complete backup set, or current signature chain.

get_nth_last_backup_chain(self, n)

source code 

Return the nth-to-last full backup of the collection, or None if there is less than n backup chains.

NOTE: n = 1 -> time of latest available chain (n = 0 is not a valid input). Thus the second-to-last is obtained with n=2 rather than n=1.

get_older_than(self, t)

source code 

Returns a list of backup sets older than the given time t

All of the times will be associated with an intact chain. Furthermore, none of the times will be of a set which a newer set may depend on. For instance, if set A is a full set older than t, and set B is an incremental based on A which is newer than t, then the time of set A will not be returned.

get_older_than_required(self, t)

source code 

Returns list of old backup sets required by new sets

This function is similar to the previous one, but it only returns the times of sets which are old but part of the chains where the newer end of the chain is newer than t.