Package timedrive :: Package utils :: Module duplicity_interface
[frames] | no frames]

Module duplicity_interface

Functions
 
get_snapshot_list(archive_url, gnu_passphrase, sync_remote=True, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)
Retrieves a list of the snapshots that are currently available in a given archive.
 
delete_backup(archive_url, gnu_passphrase, backup_time, sync_remote=True, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)
Deletes the backup sets specified by archive_url and backup_time
 
get_backup_sets(col_stats, backup_time1, backup_time2=None)
Retreives the backup sets of col_stats between backup_time1 and backup_time2.
path_iter
get_file_list(archive_url, gnu_passphrase, sync_remote=True, time=None, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)
Retrieve the file_list from the specified archive url.
Boolean, String
run_cleanup_backupset(archive_url, gnu_passphrase, sync_remote=True, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)
Method that checks the specified backup set to see if files left from failed backups need to be removed.
 
get_collection_status(archive_url, gnu_passphrase=None, sync_remote=True, time=None, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)
Retrieves a valid backend, archive dir, and collection status objects from the supplied archive_url, gnu_passphrase and other pertinent information.
Boolean
test_connection_url(archive_url, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)
Test the remote conneciton to ensure that it is valid
 
restore_file(relative_path, archive_url, gnu_passphrase, destination, restore_time=None, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)
Restores the file specified by relative_path to destination
 
start_backup(path, archive_url, gnu_passphrase, ExcludeList=None, FullBackupInterval=None, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)
Begins a new backup operation for the specified path and archive url.
Boolean, String
cleanup_backupset(col_stats, dry_run=False)
Delete the extraneous files in the current backend
 
cleanup_globals()
Returns global variables to default states after action has finished.
 
get_version(version_string)
Returns: list with the [major, minor, revision] version numbers for Duplicity, e.g.
 
get_archive_dir(archive_url)
Returns: Path to the directory where the local archive cache is stored.
path_iter (duplicity class)
list_current(col_stats)
Returns a list of the files that are currently in the archive.
 
check_sig_chain(col_stats)
Get last signature chain for inc backup, or None if none avaialble.
void
sync_archive(backend, gnu_passphrase)
Synchronize local archive manifest file and sig chains to remote archives.
Variables
  allow_source_mismatch = False
  __package__ = 'timedrive.utils'

Imports: os, subprocess, sys, time, backend, collections, commandline, diffdir, dup_time, dup_temp, file_naming, patchdir, globals, gpg, log, path, duplicity


Function Details

get_backup_sets(col_stats, backup_time1, backup_time2=None)

 

Retreives the backup sets of col_stats between backup_time1 and backup_time2. If only a single backup_time is given, it will retrieve all sets for the chain. backup_time1 < backup_time2

get_file_list(archive_url, gnu_passphrase, sync_remote=True, time=None, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)

 

Retrieve the file_list from the specified archive url.

Parameters:
  • archive_url (String) - valid duplicity archive url
  • gnu_passphrase (String) - the passphrase for the specified url
  • sync_remote (Boolean) - Default = True: Will first make sure that the local file list is in sync with the remote file list.
  • time (String) - Default = None: Specify the time from which to list files. Date should be provided in the format year-month-date. Ex: 2009-04-10
  • S3_AccessId (String) - Default = None: Amazon S3 Access Id.
  • S3_SecretKey (String) - Default = None: Amazon S3 secret key.
  • S3_BucketType (String) - Default = None: Amazon S3 Bucket Type.
Returns: path_iter
list of files contained in the archive. Can be parsed with utils.ParseDirectoryStructure.

run_cleanup_backupset(archive_url, gnu_passphrase, sync_remote=True, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)

 

Method that checks the specified backup set to see if files left from failed backups need to be removed.

Parameters:
  • archive_url (String) - valid duplicity archive url
  • gnu_passphrase (String) - the passphrase for the specified url
  • sync_remote (Boolean) - Default = True: Will first make sure that the local file list is in sync with the remote file list.
  • time (String) - Default = None: Specify the time from which to list files. Date should be provided in the format year-month-date. Ex: 2009-04-10
  • S3_AccessId (String) - Default = None: Amazon S3 Access Id.
  • S3_SecretKey (String) - Default = None: Amazon S3 secret key.
  • S3_BucketType (String) - Default = None: Amazon S3 Bucket Type.
Returns: Boolean, String

get_collection_status(archive_url, gnu_passphrase=None, sync_remote=True, time=None, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)

 

Retrieves a valid backend, archive dir, and collection status objects from the supplied archive_url, gnu_passphrase and other pertinent information. Requires that the log already be open. Thi smethod leaves the connection open for further operations and needs to be closed in the function that makes thse call

Parameters:
  • archive_url (String) - valid duplicity archive url
  • gnu_passphrase (String) - the passphrase for the specified url
  • sync_remote (Boolean) - Default = True: Will first make sure that the local file list is in sync with the remote file list.
  • time (String) - Default = None: Specify the time from which to list files. Date should be provided in the format year-month-date. Ex: 2009-04-10
  • S3_AccessId (String) - Default = None: Amazon S3 Access Id.
  • S3_SecretKey (String) - Default = None: Amazon S3 secret key.
  • S3_BucketType (String) - Default = None: Amazon S3 Bucket Type.

test_connection_url(archive_url, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)

 

Test the remote conneciton to ensure that it is valid

Parameters:
  • archive_url (String) - valid duplicity archive url
  • S3_AccessId (String) - Default = None: Amazon S3 Access Id.
  • S3_SecretKey (String) - Default = None: Amazon S3 secret key.
  • S3_BucketType (String) - Default = None: Amazon S3 Bucket Type.
Returns: Boolean

start_backup(path, archive_url, gnu_passphrase, ExcludeList=None, FullBackupInterval=None, S3_AccessId=None, S3_SecretKey=None, S3_BucketType=None)

 

Begins a new backup operation for the specified path and archive url. Supports exclusions (ExcludeList, Default = None) and setting how often a new full backup should be made (FullBackupInterval, Default = None)

cleanup_backupset(col_stats, dry_run=False)

 

Delete the extraneous files in the current backend

Parameters:
  • col_stats (CollectionStatus object) - collection status
  • dry_run (Boolean) - default = False:
Returns: Boolean, String
First: Returns true if the operation completes without errors. Otherwise returns false Second: A summary of the action taken.

get_version(version_string)

 
Parameters:
  • version_string - duplicity version string, from duplicity globals structure
Returns:
list with the [major, minor, revision] version numbers for Duplicity, e.g. version 0.6.02 would be major = 0, minor = 6, revision = 2

get_archive_dir(archive_url)

 
Parameters:
  • archive_url - URL to archive
Returns:
Path to the directory where the local archive cache is stored.

list_current(col_stats)

 

Returns a list of the files that are currently in the archive. The list is generated by examining the signature only.

Parameters:
  • col_stats (CollectionStatus object) - collection status
Returns: path_iter (duplicity class)
path_iter which contains the contents of the specified file collection

check_sig_chain(col_stats)

 

Get last signature chain for inc backup, or None if none avaialble.

Parameters:
  • col_stats (CollectionStatus object) - collection status

sync_archive(backend, gnu_passphrase)

 

Synchronize local archive manifest file and sig chains to remote archives. Copy missing files from remote to local as needed to make sure the local archive is synchronized to remote storage.

Parameters:
  • gnu_passphrase (string) - the encryption key to the archive

    #@type encryption: Boolean (True/False) #@param encryption: whether the archive is encrypted or not. Provided by the settings.

  • backend (backend class)
Returns: void
void