duplicity.backends.onedrivebackend module

class duplicity.backends.onedrivebackend.OneDriveBackend(parsed_url)[source]

Bases: duplicity.backend.Backend

Uses Microsoft OneDrive (formerly SkyDrive) for backups.

API_URI = 'https://apis.live.net/v5.0/'
BITS_1_5_UPLOAD_PROTOCOL = '{7df0354d-249b-430f-820d-3d2a9bef4931}'
CLIENT_ID = '000000004C12E85D'
CLIENT_SECRET = 'k1oR0CbtbvTG9nK1PEDeVW2dzvAaiN4d'
MAXIMUM_FRAGMENT_SIZE = 62914560
OAUTH_AUTHORIZE_URI = 'https://login.live.com/oauth20_authorize.srf'
OAUTH_REDIRECT_URI = 'https://login.live.com/oauth20_desktop.srf'
OAUTH_SCOPE = ['wl.skydrive', 'wl.skydrive_update', 'wl.offline_access']
OAUTH_TOKEN_PATH = '/Users/ken/.duplicity_onedrive_oauthtoken.json'
OAUTH_TOKEN_URI = 'https://login.live.com/oauth20_token.srf'
get_file_id(remote_filename)[source]

Returns the file id from cache, updating the cache if necessary.

get_files(path)[source]
initialize_oauth2_session()[source]
mkdir(object_id, folder_name)[source]
resolve_directory()[source]

Ensures self.directory_id contains the folder id for the path.

There is no API call to resolve a logical path (e.g. /backups/duplicity/notebook/), so we recursively list directories until we get the object id of the configured directory, creating directories as necessary.