Back In Time Development Documentation Release 1.1.12

Germar Reitze

Nov 17, 2018

Contents

1 common 3 1.1 applicationinstance module...... 3 1.2 askpass module...... 4 1.3 backintime module...... 4 1.4 bcolors module...... 7 1.5 cli module...... 7 1.6 config module...... 8 1.7 configfile module...... 15 1.8 driveinfo module...... 21 1.9 dummytools module...... 21 1.10 encfstools module...... 22 1.11 exceptions module...... 23 1.12 guiapplicationinstance module...... 24 1.13 logger module...... 24 1.14 mount module...... 25 1.15 password module...... 32 1.16 password_ipc module...... 33 1.17 pluginmanager module...... 33 1.18 progress module...... 34 1.19 snapshotlog module...... 34 1.20 snapshots module...... 36 1.21 sshMaxArg module...... 47 1.22 sshtools module...... 48 1.23 tools module...... 51

2 Indices and tables 65

Python Module Index 67

i ii Back In Time Development Documentation, Release 1.1.12

Contents:

Contents 1 Back In Time Development Documentation, Release 1.1.12

2 Contents CHAPTER 1

common

1.1 applicationinstance module class applicationinstance.ApplicationInstance(pidFile, autoExit=True, flock=False) Bases: object Class used to handle one application instance mechanism. Parameters • pidFile (str) – full path of file used to save pid and procname • autoExit (bool) – automatically call sys.exit if there is an other instance running • flock (bool) – use file-locks to make sure only one instance is checking at the same time busy() Check if one application with this instance is currently running. Returns True if an other instance is currently running. Return type bool check(autoExit=False) Check if the current application is already running Parameters autoExit (bool) – automatically call sys.exit if there is an other instance run- ning Returns True if this is the only application instance Return type bool exitApplication() Called when the single instance exit (remove pid file) flockExclusiv() Create an exclusive lock to block a second instance while the first instance is starting.

3 Back In Time Development Documentation, Release 1.1.12

flockUnlock() Remove the exclusive lock. Second instance can now continue but should find it self to be obsolete. readPidFile() Read the pid and procname from the file Returns tuple of (pid(int), procname(str)) Return type tuple startApplication() Called when the single instance starts to save its pid

1.2 askpass module

1.3 backintime module

class backintime.PseudoAliasAction(option_strings, dest, nargs=None, const=None, de- fault=None, type=None, choices=None, required=False, help=None, metavar=None) Bases: argparse.Action Translate ‘–COMMAND’ into ‘COMMAND’ for backwards compatibility. backintime._mount(cfg) Mount external filesystems. Parameters cfg (config.Config) – config that should be used backintime._umount(cfg) Unmount external filesystems. Parameters cfg (config.Config) – config that should be used backintime.aliasParser(args) Call commands which where given with leading – for backwards compatibility. Parameters args (argparse.Namespace) – previously parsed arguments backintime.argParse(args) Parse arguments given on commandline. Parameters args (argparse.Namespace) – Namespace that should be enhanced or None Returns new parsed Namespace Return type argparser.Namespace backintime.backup(args, force=True) Command for force taking a new snapshot. Parameters • args (argparse.Namespace) – previously parsed arguments • force (bool) – take the snapshot even if it wouldn’t need to or would be prevented (e.g. running on battery) Raises SystemExit – 0 if successful, 1 if not

4 Chapter 1. common Back In Time Development Documentation, Release 1.1.12 backintime.backupJob(args) Command for taking a new snapshot in background. Mainly used for cronjobs. This will run the snapshot inside a daemon and detach from it. It will return immediately back to commandline. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.benchmarkCipher(args) Command for transferring a file with scp to remote host with all available ciphers and print its speed and time. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.checkConfig(args) Command for checking the config file. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 if config is okay, 1 if not backintime.createParsers(app_name=’backintime’) Define parsers for commandline arguments. Parameters app_name (str) – string representing the current application backintime.decode(args) Command for decoding paths given paths with ‘encfsctl’. Will listen on stdin if no path was given. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.getConfig(args, check=True) Load config and change to profile selected on commandline. Parameters • args (argparse.Namespace) – previously parsed arguments • check (bool) – if True check if config is valid Returns current config with requested profile selected Return type config.Config Raises SystemExit – 1 if profile or profile_id is no valid profile 2 if check is True and config is not configured backintime.lastSnapshot(args) Command for printing the very last snapshot in current profile. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.lastSnapshotPath(args) Command for printing the path of the very last snapshot in current profile. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.printHeader() Print application name, version and legal notes.

1.3. backintime module 5 Back In Time Development Documentation, Release 1.1.12

class backintime.printLicense(*args, **kwargs) Bases: argparse.Action Print custom license backintime.pwCache(args) Command for starting password cache daemon. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 if daemon is running, 1 if not backintime.remove(args, force=False) Command for removing snapshots. Parameters • args (argparse.Namespace) – previously parsed arguments • force (bool) – don’t ask before removing (BE CAREFUL!) Raises SystemExit – 0 backintime.removeAndDoNotAskAgain(args) Command for removing snapshots without asking before remove (BE CAREFUL!) Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.restore(args) Command for restoring files from snapshots. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.setQuiet(args) Redirect sys.stdout to /dev/null if --quiet was set on commandline. Return the original sys. stdout file object which can be used to print absolute necessary information. Parameters args (argparse.Namespace) – previously parsed arguments Returns default sys.stdout Return type sys.stdout backintime.shutdown(args) Command for shutting down the computer after the current snapshot has finished. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 if successful; 1 if it failed either because there is no active snapshot for this profile or shutdown is not supported. backintime.smartRemove(args) Command for running Smart-Remove from Terminal. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 if okay 2 if Smart-Remove is not configured backintime.snapshotsList(args) Command for printing a list of all snapshots in current profile. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0

6 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

backintime.snapshotsListPath(args) Command for printing a list of all snapshots pathes in current profile. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.snapshotsPath(args) Command for printing the full snapshot path of current profile. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0 backintime.startApp(app_name=’backintime’) Start the requested command or return config if there was no command in arguments. Parameters app_name (str) – string representing the current application Returns current config if no command was given in arguments Return type config.Config backintime.takeSnapshot(cfg, force=True) Take a new snapshot. Parameters • cfg (config.Config) – config that should be used • force (bool) – take the snapshot even if it wouldn’t need to or would be prevented (e.g. running on battery) Returns True if successful Return type bool backintime.takeSnapshotAsync(cfg, checksum=False) a new backintime process with ‘backup’ command which will take a new snapshot in background. Parameters cfg (config.Config) – config that should be used backintime.unmount(args) Command for unmounting all filesystems. Parameters args (argparse.Namespace) – previously parsed arguments Raises SystemExit – 0

1.4 bcolors module

1.5 cli module

class cli.BackupJobDaemon(func, args) Bases: tools.Daemon run() You should override this method when you subclass Daemon. It will be called after the process has been daemonized by start() or restart(). class cli.RestoreDialog(cfg, sid, what, where, **kwargs) Bases: object

1.4. bcolors module 7 Back In Time Development Documentation, Release 1.1.12

callback(line, *params) run() cli.checkConfig(cfg, crontab=True) cli.frame(msg, size=32) cli.remove(cfg, snapshot_ids=None, force=None) cli.restore(cfg, snapshot_id=None, what=None, where=None, **kwargs) cli.selectSnapshot(snapshotsList, cfg, snapshot_id=None, msg=’SnapshotID’) check if given snapshot is valid. If not print a list of all snapshots and ask to choose one cli.terminalSize() get terminal size

1.6 config module class config.Config(config_path=None, data_path=None) Bases: configfile.ConfigFileWithProfiles APP_NAME = 'Back In Time' AT_EVERY_BOOT = 1 CONFIG_VERSION = 6 COPYRIGHT = 'Copyright (C) 2008-2017 Oprea Dan, Bart de Koning, Richard Bailey, Germar Reitze' CUSTOM_HOUR = 19 DAY = 20 DEFAULT_EXCLUDE = ['.', '.cache/*', '.thumbnails*', '.local/share/[Tt]rash*', '*.backup*', '*~', '.dropbox*', '/proc/*', '/sys/*', '/dev/*', '/run/*', '/etc/mtab', '/var/cache/apt/archives/*.deb', 'lost+found/*', '/tmp/*', '/var/tmp/*', '/var/backups/*', '.Private'] DEFAULT_REDIRECT_STDERR_IN_CRON = False DEFAULT_REDIRECT_STDOUT_IN_CRON = True DEFAULT_RUN_IONICE_FROM_CRON = True DEFAULT_RUN_IONICE_FROM_USER = False DEFAULT_RUN_IONICE_ON_REMOTE = False DEFAULT_RUN_NICE_FROM_CRON = True DEFAULT_RUN_NICE_ON_REMOTE = False DEFAULT_RUN_NOCACHE_ON_LOCAL = False DEFAULT_RUN_NOCACHE_ON_REMOTE = False DEFAULT_SSH_PREFIX = 'PATH=/opt/bin:/opt/sbin:\\$PATH' DISK_UNIT_GB = 20 DISK_UNIT_MB = 10 ENCODE = HOUR = 10 MIN_FREE_SPACE_UNITS = {10: 'MiB', 20: 'GiB'}

8 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

MONTH = 40 NONE = 0 PLUGIN_MANAGER = REMOVE_OLD_BACKUP_UNITS = {20: 'Day(s)', 30: 'Week(s)', 80: 'Year(s)'} REPEATEDLY = 25 REPEATEDLY_UNITS = {10: 'Hour(s)', 20: 'Day(s)', 30: 'Week(s)', 40: 'Month(s)'} SCHEDULE_MODES = {0: 'Disabled', 1: 'At every boot/reboot', 2: 'Every 5 minutes', 4: 'Every 10 minutes', 7: 'Every 30 minutes', 10: 'Every hour', 12: 'Every 2 hours', 14: 'Every 4 hours', 16: 'Every 6 hours', 18: 'Every 12 hours', 19: 'Custom Hours', 20: 'Every Day', 25: 'Repeatedly (anacron)', 27: 'When drive get connected (udev)', 30: 'Every Week', 40: 'Every Month'} SNAPSHOT_MODES = {'local': (None, 'Local', False, False), 'local_encfs': (, 'Local encrypted', 'Encryption', False), 'ssh': (, 'SSH', 'SSH private key', False), 'ssh_encfs': (, 'SSH encrypted', 'SSH private key', 'Encryption')} SSH_CIPHERS = {'3des-cbc': '3DES-CBC', 'aes128-cbc': 'AES128-CBC', 'aes128-ctr': 'AES128-CTR', 'aes192-cbc': 'AES192-CBC', 'aes192-ctr': 'AES192-CTR', 'aes256-cbc': 'AES256-CBC', 'aes256-ctr': 'AES256-CTR', 'arcfour': 'ARCFOUR', 'arcfour128': 'ARCFOUR128', 'arcfour256': 'ARCFOUR256', 'blowfish-cbc': 'Blowfish-CBC', 'cast128-cbc': 'Cast128-CBC', 'default': 'Default'} SYSTEM_ENTRY_MESSAGE = '#Back In Time system entry, this will be edited by the gui:' UDEV = 27 VERSION = '1.2.0~alpha0' WEEK = 30 YEAR = 80 anacronJobIdentify(profile_id=None) anacronSpool() anacronSpoolFile(profile_id=None) anacrontab(suffix=”) Deprecated since 1.1. Just keep this to delete old anacrontab files anacrontabFiles() list existing old anacrontab files appInstanceFile() appPath() authors() backupOnRestore(profile_id=None) backupScheduled(profile_id=None) check if profile is supposed to be run this time bwlimit(profile_id=None) bwlimitEnabled(profile_id=None) canBackup(profile_id=None) Checks if snapshots_path exists changelog() checkConfig() continueOnErrors(profile_id=None) copyLinks(profile_id=None) copyUnsafeLinks(profile_id=None) createNewCrontab(oldCrontab)

1.6. config module 9 Back In Time Development Documentation, Release 1.1.12

cronCmd(profile_id) cronEnvFile() cronLine(profile_id) customBackupTime(profile_id=None) docPath() dontRemoveNamedSnapshots(profile_id=None) encfsconfigBackupFolder(profile_id=None) exclude(profile_id=None) Gets the exclude patterns excludeBySize(profile_id=None) excludeBySizeEnabled(profile_id=None) excludeV4(profile_id=None) Gets the exclude patterns: conf version 4 exp = ' EXPERIMENTAL!' fileId(profile_id=None) globalFlock() hashCollision() host() hostUserProfile(profile_id=None) hostUserProfileDefault(profile_id=None) include(profile_id=None) includeV4(profile_id=None) incrementHashCollision() ioniceOnCron(profile_id=None) ioniceOnRemote(profile_id=None) ioniceOnUser(profile_id=None) isConfigured(profile_id=None) Checks if the program is configured keepOnlyOneSnapshot(profile_id=None) keyringServiceName(profile_id=None, mode=None, pw_id=1) keyringUserName(profile_id=None) lastSnapshotSymlink(profile_id=None) license() localEncfsPath(profile_id=None) logLevel(profile_id=None) minFreeInodes(profile_id=None) minFreeInodesEnabled(profile_id=None)

10 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

minFreeSpace(profile_id=None) minFreeSpaceEnabled(profile_id=None) minFreeSpaceMib(profile_id=None) modeNeedPassword(mode, pw_id=1) niceOnCron(profile_id=None) niceOnRemote(profile_id=None) noSnapshotOnBattery(profile_id=None) nocacheOnLocal(profile_id=None) nocacheOnRemote(profile_id=None) notify(profile_id=None) olderThan(time, value, unit) return True if time is older than months, weeks, days or hours password(parent=None, profile_id=None, mode=None, pw_id=1, only_from_keyring=False) passwordCacheFifo() passwordCacheFolder() passwordCacheInfo() passwordCachePid() passwordSave(profile_id=None, mode=None) passwordUseCache(profile_id=None, mode=None) pid() preparePath(path) preserveAcl(profile_id=None) preserveXattr(profile_id=None) redirectStderrInCron(profile_id=None) redirectStdoutInCron(profile_id=None) removeOldCrontab(crontab) removeOldSnapshots(profile_id=None) removeOldSnapshotsDate(profile_id=None) removeOldSnapshotsEnabled(profile_id=None) restoreInstanceFile(profile_id=None) restoreLogFile(profile_id=None) rsyncOptions(profile_id=None) rsyncOptionsEnabled(profile_id=None) save() Save all options to file. Parameters filename (str) – full path Returns True if successful

1.6. config module 11 Back In Time Development Documentation, Release 1.1.12

Return type bool scheduleDay(profile_id=None) scheduleMode(profile_id=None) scheduleRepeatedPeriod(profile_id=None) scheduleRepeatedUnit(profile_id=None) scheduleTime(profile_id=None) scheduleWeekday(profile_id=None) setBackupOnRestore(value, profile_id=None) setBwlimit(enabled, value, profile_id=None) setContinueOnErrors(value, profile_id=None) setCopyLinks(value, profile_id=None) setCopyUnsafeLinks(value, profile_id=None) setCurrentHashId(hash_id) setCustomBackupTime(value, profile_id=None) setDontRemoveNamedSnapshots(value, profile_id=None) setExclude(values, profile_id=None) setExcludeBySize(enabled, value, profile_id=None) setGlobalFlock(value) setHostUserProfile(host, user, profile, profile_id=None) setInclude(values, profile_id=None) setIoniceOnCron(value, profile_id=None) setIoniceOnRemote(value, profile_id=None) setIoniceOnUser(value, profile_id=None) setKeepOnlyOneSnapshot(value, profile_id=None) setLocalEncfsPath(value, profile_id=None) setLogLevel(value, profile_id=None) setMinFreeInodes(enabled, value, profile_id=None) setMinFreeSpace(enabled, value, unit, profile_id=None) setNiceOnCron(value, profile_id=None) setNiceOnRemote(value, profile_id=None) setNoSnapshotOnBattery(value, profile_id=None) setNocacheOnLocal(value, profile_id=None) setNocacheOnRemote(value, profile_id=None) setNotify(value, profile_id=None) setPassword(password, profile_id=None, mode=None, pw_id=1) setPasswordSave(value, profile_id=None, mode=None)

12 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

setPasswordUseCache(value, profile_id=None, mode=None) setPreserveAcl(value, profile_id=None) setPreserveXattr(value, profile_id=None) setRedirectStderrInCron(value, profile_id=None) setRedirectStdoutInCron(value, profile_id=None) setRemoveOldSnapshots(enabled, value, unit, profile_id=None) setRsyncOptions(enabled, value, profile_id=None) setScheduleDay(value, profile_id=None) setScheduleMode(value, profile_id=None) setScheduleRepeatedPeriod(value, profile_id=None) setScheduleRepeatedUnit(value, profile_id=None) setScheduleTime(value, profile_id=None) setScheduleWeekday(value, profile_id=None) setSmartRemove(value, keep_all, keep_one_per_day, keep_one_per_week, keep_one_per_month, profile_id=None) setSmartRemoveRunRemoteInBackground(value, profile_id=None) setSnapshotsMode(value, profile_id=None) setSnapshotsPath(value, profile_id=None, mode=None) Sets the snapshot path to value, initializes, and checks it setSshCheckCommands(value, profile_id=None) setSshCheckPingHost(value, profile_id=None) setSshCipher(value, profile_id=None) setSshHost(value, profile_id=None) setSshMaxArgLength(value, profile_id=None) setSshPort(value, profile_id=None) setSshPrefix(enabled, value, profile_id=None) setSshPrivateKeyFile(value, profile_id=None) setSshSnapshotsPath(value, profile_id=None) setSshUser(value, profile_id=None) setTakeSnapshotRegardlessOfChanges(value, profile_id=None) setUseChecksum(value, profile_id=None) setupCron() smartRemove(profile_id=None) smartRemoveRunRemoteInBackground(profile_id=None) snapshotsFullPath(profile_id=None) Returns the full path for the snapshots: . . . /backintime/machine/user/profile_id/ snapshotsMode(profile_id=None)

1.6. config module 13 Back In Time Development Documentation, Release 1.1.12

snapshotsPath(profile_id=None, mode=None, tmp_mount=False) snapshotsSymlink(profile_id=None, tmp_mount=False) sshCheckCommands(profile_id=None) sshCheckPingHost(profile_id=None) sshCipher(profile_id=None) sshCommand(cmd=None, custom_args=None, port=True, cipher=True, user_host=True, ionice=True, nice=True, quote=False, prefix=True, profile_id=None) Return SSH command with all arguments. Parameters • cmd (list) – command that should run on remote host • custom_args (list) – additional arguments paste to the command • port (bool) – use port from config • cipher (bool) – use cipher from config • user_host (bool) – use user@host from config • ionice (bool) – use ionice if configured • nice (bool) – use nice if configured • quote (bool) – quote remote command • prefix (bool) – use prefix from config before remote command • profile_id (str) – profile ID that should be used in config Returns ssh command with chosen arguments Return type list sshDefaultArgs(profile_id=None) Default arguments used for ssh and sshfs commands. Returns arguments for ssh Return type list sshHost(profile_id=None) sshHostUserPortPathCipher(profile_id=None) sshMaxArgLength(profile_id=None) sshPort(profile_id=None) sshPrefix(profile_id=None) sshPrefixCmd(profile_id=None, cmd_type=) sshPrefixEnabled(profile_id=None) sshPrivateKeyFile(profile_id=None) sshPrivateKeyFolder() sshSnapshotsFullPath(profile_id=None) Returns the full path for the snapshots: . . . /backintime/machine/user/profile_id/ sshSnapshotsPath(profile_id=None) sshUser(profile_id=None)

14 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

tag(profile_id=None) takeSnapshotInstanceFile(profile_id=None) takeSnapshotLogFile(profile_id=None) takeSnapshotMessageFile(profile_id=None) takeSnapshotProgressFile(profile_id=None) takeSnapshotRegardlessOfChanges(profile_id=None) takeSnapshotUserCallback() translations() udevRulesPath() useChecksum(profile_id=None) user() portable way to get username cc by-sa 3.0 http://stackoverflow.com/a/19865396/1139841 author: techtonik http://stackoverflow.com/users/239247/techtonik userCallbackNoLogging(profile_id=None)

1.7 configfile module class configfile.ConfigFile Bases: object Store options in a plain text file in form of: key=value append(filename, maxsplit=1) Load options from file and append them to current options. Parameters • filename (str) – full path • maxsplit (int) – split lines only n times on ‘=’ askQuestion(message) Call previously registered function to ask a question. Parameters message (str) – question that should be shown boolValue(key, default=False) Return a ‘bool’ instance of key’s value. Parameters • key (str) – string used as key • default (bool) – return this if key is not set Returns value of ‘key’ or ‘default’ if ‘key’ is not set. Return type bool clearHandlers() Reset error and question handlers.

1.7. configfile module 15 Back In Time Development Documentation, Release 1.1.12

hasKey(key) True if key is set. Parameters key (str) – string used as key Returns True if the key is set Return type bool intValue(key, default=0) Return a ‘int’ instance of key’s value. Parameters • key (str) – string used as key • default (int) – return this if key is not set Returns value of key or default if key is not set. Return type int keys() listValue(key, type_key=’str:value’, default=[]) Return a list of values Size of the list must be stored in key.size Parameters • key (str) – used base-key • type_key (str) – pattern of ‘value-type:value-name’. See examples below. • default (list) – default value Returns value of key or default if key is not set. Return type list type_key pattern examples:

'str:value'=> return str values from key.value 'int:type'=> return int values from key.type 'bool:enabled'=> return bool values from key.enabled ('str:value','int:type')=> return tuple of values

load(filename, **kwargs) Reset current options and load new options from file. Parameters filename (str) – full path notifyError(message) Call previously registered function to show an error. Parameters message (str) – error message that should be shown remapKey(old_key, new_key) Remap keys to a new key name. Parameters • old_key (str) – old key name

16 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

• new_key (str) – new key name remapKeyRegex(pattern, replace) Remap keys to a new key name using re.sub(). Parameters • pattern (str) – part of key name that should be replaced • replace (str, method) – string or a callable function which will be used to replace all matches of pattern. removeKey(key) Remove key from options. Parameters key (str) – string used as key removeKeysStartsWith(prefix) Remove key from options which start with given prefix. Parameters prefix (str) – prefix for keys (key starts with this string) that should be removed save(filename) Save all options to file. Parameters filename (str) – full path Returns True if successful Return type bool setBoolValue(key, value) Set a bool value for key. Parameters • key (str) – string used as key • value (bool) – store this option setErrorHandler(handler) Register a function that should be called for notifying errors. handler (method): callable function setIntValue(key, value) Set an integer value for key. Parameters • key (str) – string used as key • value (int) – store this option setListValue(key, type_key, value) Set a list of values. Size of the list will be stored in key.size Parameters • key (str) – used base-key • type_key (str) – pattern of ‘value-type:value-name’. See examples below. • value (list) – that should be stored type_key pattern examples:

1.7. configfile module 17 Back In Time Development Documentation, Release 1.1.12

'str:value'=> return str values from key.value 'int:type'=> return int values from key.type 'bool:enabled'=> return bool values from key.enabled ('str:value','int:type')=> return tuple of values

setQuestionHandler(handler) Register a function that should be called for asking questions. handler (method): callable function setStrValue(key, value) Set a string value for key. Parameters • key (str) – string used as key • value (str) – store this value strValue(key, default=”) Return a ‘str’ instance of key’s value. Parameters • key (str) – string used as key • default (str) – return this if key is not set Returns value of key or default if key is not set. Return type str class configfile.ConfigFileWithProfiles(default_profile_name=”) Bases: configfile.ConfigFile Store options in profiles as ‘profileX.key=value’ Parameters default_profile_name (str) – default name of the first profile. addProfile(name) Add a new profile if the name is not already in use. Parameters name (str) – new profile name Returns new profile ID Return type str append(filename) Load options from file and append them to current options. Parameters filename (str) – full path currentProfile() Currently selected profile ID. Profile IDs are strings! Returns profile ID Return type str hasProfileKey(key, profile_id=None) True if key is set in profile. Parameters

18 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

• key (str) – string used as key • profile_id (str, int) – valid profile ID Returns True if key is set. Return type bool load(filename) Reset current options and load new options from file. Parameters filename (str) – full path profileBoolValue(key, default=False, profile_id=None) profileExists(profile_id) True if the profile exists. Parameters profile_id (str, int) – profile ID Returns True if profile_id exists. Return type bool profileExistsByName(name) True if the profile exists. Parameters name (str) – profile name Returns True if name exists. Return type bool profileIntValue(key, default=0, profile_id=None) profileKey(key, profile_id=None) Prefix for keys with profile. e.g. ‘profile1.key’ Parameters • key (str) – key name • profile_id (str, int) – valid profile ID Returns key with prefix ‘profile1.key’ Return type str profileListValue(key, type_key=’str:value’, default=[], profile_id=None) profileName(profile_id=None) Name of the profile. Parameters profile_id (str, int) – valid profile ID Returns name of profile Return type str profileStrValue(key, default=”, profile_id=None) profiles() List of all available profile IDs. Profile IDs are strings! Returns all available profile IDs as strings Return type list

1.7. configfile module 19 Back In Time Development Documentation, Release 1.1.12

profilesSortedByName() List of available profile IDs alphabetically sorted by their names. Profile IDs are strings! Returns all available profile IDs as strings Return type list remapProfileKey(oldKey, newKey, profileId=None) Remap profile keys to a new key name. Parameters • oldKey (str) – old key name • newKey (str) – new key name • profileId (str, int) – valid profile ID removeProfile(profile_id=None) Remove profile and all its keys and values. Parameters profile_id (str, int) – valid profile ID Returns True if successful Return type bool removeProfileKey(key, profile_id=None) Remove the key from profile. Parameters • key (str) – key name • profile_id (str, int) – valid profile ID removeProfileKeysStartsWith(prefix, profile_id=None) Remove the keys starting with prefix from profile. Parameters • prefix (str) – prefix for keys (key starts with this string) that should be removed. • profile_id (str, int) – valid profile ID setCurrentProfile(profile_id) Change the current profile. Parameters profile_id (str, int) – valid profile ID Returns True if successful Return type bool setCurrentProfileByName(name) Change the current profile. Parameters name (str) – valid profile name Returns True if successful Return type bool setProfileBoolValue(key, value, profile_id=None) setProfileIntValue(key, value, profile_id=None) setProfileListValue(key, type_key, value, profile_id=None)

20 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

setProfileName(name, profile_id=None) Change the name of the profile. Parameters • name (str) – new profile name • profile_id (str, int) – valid profile ID Returns True if successful. Return type bool setProfileStrValue(key, value, profile_id=None)

1.8 driveinfo module class driveinfo.DriveInfo(path) Bases: configfile.ConfigFile support_hardlinks() support_permissions() support_usergroup()

1.9 dummytools module class dummytools.Dummy(*args, **kwargs) Bases: mount.MountControl This is a template for mounting services. For simple mount services all you need to do is: - add your settings in qt/settingsdialog.py - add settings in common/config.p - modify a copy of this file Please use self.currentMountpoint as your local mountpoint. This class inherit from mount.MountControl. All methodes from MountControl can be used exactly like they were in this class. Methodes from MountControl also can be overriden in here if you need something different. _mount() mount the service _umount() umount the service postMountCheck() check if mount was successful raise MountException(_(‘Error discription’)) if not postUmountCheck() check if umount successful raise MountException(_(‘Error discription’)) if not preMountCheck(first_run=False) check what ever conditions must be given for the mount to be done successful raise Moun- tException(_(‘Error discription’)) if service can not mount return True if everything is okay all pre|post_[u]mount_check can also be used to prepare things or clean up preUmountCheck() check if service is safe to umount raise MountException(_(‘Error discription’)) if not

1.8. driveinfo module 21 Back In Time Development Documentation, Release 1.1.12

1.10 encfstools module class encfstools.Bounce Bases: object Dummy class that will simply return all input. This is the standard for config.ENCODE close() exclude(path) include(path) path(path) remote(path) class encfstools.Decode(cfg, string=True) Bases: object decode path with encfsctl. close() stop encfsctl process list(list_) decode a list of paths log(line) decode paths in takesnapshot.log path(path) write crypted path to encfsctl stdin and read plain path from stdout if stdout is empty (most likly because there was an error) return crypt path pathMatch(m) return decoded path of a match object pathWithArrow(path) rsync print symlinks like ‘dest -> src’. This will decode both and also normal paths remote(path) decode the path on remote host starting from backintime/host/user/. . . replace(m) return decoded string for re.sub startProcess() start ‘encfsctl decode’ process in pipe mode. class encfstools.EncFS_SSH(cfg=None, profile_id=None, mode=None, parent=None, *args, **kwargs) Bases: encfstools.EncFS_mount Mount encrypted remote path with sshfs and . Mount / with encfs –reverse. rsync will then sync the encrypted view on / to the remote path mount(*args, **kwargs) call mount for sshfs, encfs –reverse and encfs register ‘encfsctl encode’ in config.ENCODE preMountCheck(*args, **kwargs) call preMountCheck for sshfs, encfs –reverse and encfs splitKwargs(mode) split all given arguments for the desired mount class

22 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

umount(*args, **kwargs) close ‘encfsctl encode’ process and set config.ENCODE back to the dummy class. call umount for encfs, encfs –reverse and sshfs class encfstools.EncFS_mount(*args, **kwargs) Bases: mount.MountControl Mount encrypted paths with encfs. _mount() mount the service backupConfig() create a backup of encfs config file into local config folder so in cases of the config file get deleted or corrupt user can restore it from there checkVersion() check encfs version. 1.7.2 had a bug with –reverse that will create corrupt files configFile() return encfs config file env() return environment with encfs configfile isConfigured() check if encfs config file exist. If not and if we are in settingsdialog ask for password confirmation. _mount will then create a new config preMountCheck(first_run=False) check what ever conditions must be given for the mount class encfstools.Encode(encfs) Bases: object encode path with encfsctl. ENCFS_SSH will replace config.ENCODE whit this close() stop encfsctl process exclude(path) encrypt paths for snapshots.takeSnapshot exclude list. After encoding the path a wildcard would not match anymore so all paths with wildcards are ignored. Only single and double asterisk that will match a full file or folder name will work. include(path) encrypt paths for snapshots.takeSnapshot include list. path(path) write plain path to encfsctl stdin and read encrypted path from stdout remote(path) encode the path on remote host starting from backintime/host/user/. . . startProcess() start ‘encfsctl encode’ process in pipe mode.

1.11 exceptions module exception BackInTimeException Bases: Exception

1.11. exceptions module 23 Back In Time Development Documentation, Release 1.1.12

exception EncodeValueError Bases: exceptions.BackInTimeException exception HashCollision Bases: exceptions.BackInTimeException exception InvalidChar(msg) Bases: exceptions.BackInTimeException exception InvalidCmd(msg) Bases: exceptions.BackInTimeException exception KnownHost Bases: exceptions.MountException exception LastSnapshotSymlink Bases: exceptions.BackInTimeException exception LimitExceeded(msg) Bases: exceptions.BackInTimeException exception MountException Bases: exceptions.BackInTimeException exception NoPubKeyLogin Bases: exceptions.MountException exception PermissionDeniedByPolicy(msg) Bases: exceptions.BackInTimeException exception StopException Bases: exceptions.BackInTimeException exception Timeout Bases: exceptions.BackInTimeException

1.12 guiapplicationinstance module

class guiapplicationinstance.GUIApplicationInstance(baseControlFile, raiseCmd=”) Bases: applicationinstance.ApplicationInstance class used to handle one application instance mechanism check(raiseCmd) check if the current application is already running raiseCommand() check if the application must to be raised return None if no raise needed, or a string command to raise

1.13 logger module logger.changeProfile(profile_id) logger.closelog() logger.debug(msg, parent=None, traceDepth=0) logger.deprecated(parent=None)

24 Chapter 1. common Back In Time Development Documentation, Release 1.1.12 logger.error(msg, parent=None, traceDepth=0) logger.info(msg, parent=None, traceDepth=0) logger.openlog() logger.warning(msg, parent=None, traceDepth=0)

1.14 mount module class mount.Mount(cfg=None, profile_id=None, tmp_mount=False, parent=None) Bases: object This is the high-level mount API. This will handle mount, umount, remount and checks on the low-level MountControl subclass backends for BackInTime. If cfg is None this will load the default config. If profile_id is None it will use configfile. ConfigFileWithProfiles.currentProfile(). If the current profile uses Password-Cache and the Password-Cache is not running this will try to start it. Parameters • cfg (config.Config) – current config • profile_id (str) – profile ID that should be used • tmp_mount (bool) – if True mount to a temporary destination • parent (QWidget) – parent widget for QDialogs or None if there is no parent mount(mode=None, check=True, **kwargs) High-level mount. Check if the selected mode need to be mounted, select the low-level backend and mount it. Parameters • mode (str) – mode to use. One of ‘local’, ‘ssh’, ‘local_encfs’ or ‘ssh_encfs’ • check (bool) – if True run MountControl.preMountCheck() before mounting • **kwargs – keyword arguments paste to low-level MountControl subclass backend Returns Hash ID used as mountpoint Return type str Raises • exceptions.MountException – if a check failed • exceptions.HashCollision – if Hash ID was used before but umount info wasn’t identical preMountCheck(mode=None, first_run=False, **kwargs) High-level check. Run MountControl.preMountCheck() to check if all conditions for Mount. mount() are set. Should be called with first_run = True to check if new settings are correct before saving them. Parameters • mode (str) – mode to use. One of ‘local’, ‘ssh’, ‘local_encfs’ or ‘ssh_encfs’

1.14. mount module 25 Back In Time Development Documentation, Release 1.1.12

• first_run (bool) – run intense checks that only need to run after changing settings but not every time before mounting • **kwargs – keyword arguments paste to low-level MountControl subclass backend Returns True if all checks where okay Return type bool Raises exceptions.MountException – if a check failed remount(new_profile_id, mode=None, hash_id=None, **kwargs) High-level remount. Unmount the old profile presented by hash_id and mount new profile new_profile_id with mode mode. If old and new mounts are the same just add new symlinks and keep the mount. Args map to profiles:

new_profile_id<= new profile mode<= new profile kwargs<= new profile hash_id<= old profile self.profile_id<= old profile

Parameters • new_profile_id (str) – Profile ID that should get mounted • mode (str) – mode to use for new mount. One of ‘local’, ‘ssh’, ‘local_encfs’ or ‘ssh_encfs’ • hash_id (str) – Hash ID used as mountpoint on the old mount, that should get un- mounted • **kwargs – keyword arguments paste to low-level MountControl subclass backend for the new mount Returns Hash ID used as mountpoint Return type str Raises • exceptions.MountException – if a check failed • exceptions.HashCollision – if Hash ID was used before but umount info wasn’t identical

umount(hash_id=None) High-level unmount. Unmount the low-level backend. This will read unmount infos written next to the mountpoint identified by hash_id and unmount it. Parameters hash_id (bool) – Hash ID used as mountpoint before that should get unmounted Raises exceptions.MountException – if a check failed class mount.MountControl(cfg=None, profile_id=None, hash_id=None, tmp_mount=False, par- ent=None, symlink=True, *args, **kwargs) Bases: object This is the low-level mount API. This should be subclassed by backends. Subclasses should have its own __init__ but must also call the inherited __init__. You must overwrite methods:

26 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

MountControl._mount() You can overwrite methods: MountControl._umount() MountControl.preMountCheck() MountControl.postMountCheck() MountControl.preUmountCheck() MountControl.postUmountCheck() These arguments must be defined in self namespace by subclassing __init__ method: mountproc (str): process used to mount log_command (str): shortened form of mount command used in logs symlink_subfolder (str):mountpoint-subfolder which should be linked

Parameters • cfg (config.Config) – current config • profile_id (str) – profile ID that should be used • hash_id (str) – crc32 hash used to identify identical mountpoints • tmp_mount (bool) – if True mount to a temporary destination • parent (QWidget) – parent widget for QDialogs or None if there is no parent • symlink (bool) – if True set symlink to mountpoint • mode (str) – one of local, local_encfs, ssh or ssh_encfs • hash_collision (int) – global value used to prevent hash collisions on mountpoints

CHECK_FUSE_GROUP = False _mount() Backend mount method. This must be overwritten in the backend which subclasses MountControl. _umount() Unmount with fusermount -u for fuse based backends. This can be overwritten by backends which subclasses MountControl. Raises exceptions.MountException – if unmount failed checkFuse() Check if command in self.mountproc is installed and user is part of group fuse. Raises exceptions.MountException – if either command is not available or user is not in group fuse checkLocks(path, lockSuffix) Check if there are active locks ending with lockSuffix in path. If the process owning the lock doesn’t exist anymore this will remove the lock. Parameters • path (str) – full path to lock • lockSuffix (str) – last part of locks name Returns True if there are active locks in path

1.14. mount module 27 Back In Time Development Documentation, Release 1.1.12

Return type bool compareRemount(old_hash_id) Compare mount arguments between current and old_hash_id. If they are identical we could reuse the mount and don’t need to remount. Parameters old_hash_id (str) – Hash ID of the old mountpoint Returns True if the old mountpoint and current are identiacal Return type bool compareUmountInfo(umount_info=None) Compare current self.all_kwargs with those from file umount_info. This should prevent hash collisions of two different mounts. Parameters umount_info (str) – full path to /umount file Returns True if self.all_kwargs and kwargs read from umount_info file are identiacal Return type bool createMountStructure() Create folders that are necessary for mounting. Folder structure in ~/.local/share/backintime/mnt/ (self.mount_root):

|\ .lock <= mountprocess lock that will prevent | different processes modifying | mountpoints at one time | |\ / <= ``self.hash_id_path`` | \ will be shared by all profiles with | | the same mount settings | | | |\ mountpoint/<= ``self.currentMountpoint`` | | real mountpoint | | | |\ umount <= ``self.umount_info`` | | json file with all nessesary args | | for unmount | | | \ locks/ <= ``self.lock_path`` | for each process you have a | ``.lock`` file | |\ _/ <= sym-link to the right path. return by | config.snapshotsPath | (can be ../mnt//mount_point | for ssh or | ../mnt/// for | fusesmb ...) | \ tmp__/ <= sym-link for testing mountpoints in settingsdialog

hash(s) Create a CRC32 hash of string s.

28 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Parameters s (str) – string that should be hashed Returns hash of string s Return type str hashIdPath(hash_id=None) Get path ~/.local/share/backintime/mnt/. Parameters hash_id (str) – Unique identifier for a mountpoint. If None use self. hash_id Returns full path to Return type str lockPath(hash_id=None) Get path ~/.local/share/backintime/mnt//locks. Parameters hash_id (str) – Unique identifier for a mountpoint Returns full path to /locks` Return type str mount(check=True) Low-level mount. Set mountprocess lock and prepair mount, run checks and than call _mount() for the subclassed backend. Finally set mount lock and symlink and release mountprocess lock. Parameters check (bool) – if True run preMountCheck() before mounting Returns Hash ID used as mountpoint Return type str Raises • exceptions.MountException – if a check failed • exceptions.HashCollision – if Hash ID was used before but umount info wasn’t identical mountLockAquire() Create a lock for a mountpoint to prevent unmounting as long as this process is still running. mountLockCheck() Check for locks on the current mountpoint. Returns True if there are any locks Return type bool mountLockRelease() Remove mountpoint lock for this process. mountProcessLockAcquire(timeout=60) Create a short term lock only for blocking other processes changing mounts at the same time. Parameters timeout (int) – wait timeout seconds before fail acquiring the lock Raises exceptions.MountException – if timed out mountProcessLockRelease() Remove mountprocess lock. mounted() Check if the mountpoint is already mounted.

1.14. mount module 29 Back In Time Development Documentation, Release 1.1.12

Returns True if mountpoint is mounted Return type bool Raises exceptions.MountException – if mountpoint is not mounted but also not empty mountpoint(hash_id=None) Get path ~/.local/share/backintime/mnt//mountpoint. Parameters hash_id (str) – Unique identifier for a mountpoint Returns full path to /mountpoint Return type str postMountCheck() Check if the mount was successful. This can be overwritten in backends which subclasses MountControl. Returns True if all checks where okay Return type bool Raises exceptions.MountException – if backend wasn’t mount successful

Note: This can also be used to clean up after running _mount()

postUmountCheck() Check if unmount was successful. This can be overwritten in backends which subclasses MountControl. Returns True if all checks where okay Return type bool Raises exceptions.MountException – if backend wasn’t unmounted successful

Note: This can also be used to clean up after running _umount()

preMountCheck(first_run=False) Check what ever conditions must be given for the mount to be done successful. This can be overwritten in backends which subclasses MountControl. Returns True if all checks where okay Return type bool Raises exceptions.MountException – if backend can not mount

Note: This can also be used to prepare things before running _mount()

preUmountCheck() Check if backend is safe to umount. This can be overwritten in backends which subclasses MountControl. Returns True if all checks where okay Return type bool Raises exceptions.MountException – if backend can not umount

30 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Note: This can also be used to prepare things before running _umount()

readUmountInfo(umount_info=None) Read keyword arguments from file umount_info. Parameters umount_info (str) – full path to /umount file. If None current /umount file will be used Returns previously written self.all_kwargs Return type dict removeSymlink(profile_id=None, tmp_mount=None) Remove symlink ~/.local/share/backintime/mnt/_ Parameters • profile_id (str) – Profile ID for the symlink • tmp_mount (bool) – Symlink is a temporary link for testing new settings setDefaultArgs() Set some arguments which are necessary for all backends. self.all_kwargs need to be filled through setattrKwargs() before calling this. setSymlink(profile_id=None, hash_id=None, tmp_mount=None) If self.symlink is True set symlink ~/.local/share/backintime/mnt/_. Target will be either the mountpoint or a subfolder of the mountpoint if self. symlink_subfolder is set. Parameters • profile_id (str) – Profile ID that should be linked. If None use self. profile_id • hash_id (str) – Hash ID of mountpoint where this sysmlink should point to. If None use self.hash_id • tmp_mount (bool) – Set a temporary symlink just for testing new settings setattrKwargs(arg, default, store=True, **kwargs) Set attribute arg in local namespace (self.arg). Also collect all args in self.all_kwargs which will be hashed later and used as mountpoint name and also be written as unmount_info. Parameters • arg (str) – argument name • default – default value used if arg is not in kwargs • store (bool) – if True add arg to self.all_kwargs • **kwargs – arguments given on backend constructor umount() Low-level umount. Set mountprocess lock, run umount checks and call _umount() for the subclassed backend. Finally release mount lock, remove symlink and release mountprocess lock. Raises exceptions.MountException – if a check failed umountInfoPath(hash_id=None) Get path ~/.local/share/backintime/mnt//umount. Parameters hash_id (str) – Unique identifier for a mountpoint

1.14. mount module 31 Back In Time Development Documentation, Release 1.1.12

Returns full path to /umount` Return type str writeUmountInfo() Write content of self.all_kwargs to file ~/.local/share/backintime/mnt// umount. This will be used to unmount the filesystem later.

1.15 password module class password.Password(cfg=None) Bases: object provide passwords for BIT either from keyring, Password_Cache or by asking User. password(parent, profile_id, mode, pw_id=1, only_from_keyring=False) based on profile settings return password from keyring, Password_Cache or by asking User. passwordFromCache(service_name, user_name) get password from Password_Cache passwordFromKeyring(service_name, user_name) get password from system keyring (seahorse). The keyring is only available if User is logged in. passwordFromUser(parent, profile_id=None, mode=None, pw_id=1, prompt=None) ask user for password. This does even work when run as cronjob and user is logged in. setPassword(password, profile_id, mode, pw_id) store password to keyring and Password_Cache setPasswordCache(service_name, user_name, password) setPasswordDb(service_name, user_name, password) internal Password cache. Prevent to ask password several times during runtime. setPasswordKeyring(service_name, user_name, password) class password.Password_Cache(cfg=None, *args, **kwargs) Bases: tools.Daemon Password_Cache get started on User login. It provides passwords for BIT cronjobs because keyring is not available when the User is not logged in. Does not start if there is no password to cache (e.g. no profile allows to cache). PW_CACHE_VERSION = 3 checkVersion() cleanupHandler(signum, frame) collectPasswords() search all profiles in config and collect passwords from keyring. reloadHandler(signum, frame) reload passwords during runtime. run() wait for password request on FIFO and answer with password from self.db through FIFO.

32 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

1.16 password_ipc module

class password_ipc.FIFO(fname) Bases: object interprocess-communication with named pipes create() create the FIFO in a way that only the current user can access it. delfifo() remove FIFO isFifo() make sure file is still a FIFO and has correct permissions read(timeout=0) read from fifo untill timeout. If timeout is 0 it will wait forever for input. write(string, timeout=0) write to fifo untill timeout. If timeout is 0 it will wait forever for an other process that will read this. class password_ipc.TempPasswordThread(string) Bases: threading.Thread in case BIT is not configured yet provide password through temp FIFO to backintime-askpass. read() read fifo to end the blocking fifo.write use only if thread timeout. run() Method representing the thread’s activity. You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively. starter() stop()

1.17 pluginmanager module class pluginmanager.Plugin Bases: object appExit() appStart() error(code, message) init(snapshots) isGui() message(profile_id, profile_name, level, message, timeout) mount(profileID=None) newSnapshot(snapshot_id, snapshot_path) processBegin()

1.16. password_ipc module 33 Back In Time Development Documentation, Release 1.1.12

processEnd() unmount(profileID=None) class pluginmanager.PluginManager Bases: object appExit() appStart() error(code, message=”) load(snapshots=None, cfg=None, force=False) logError(plugin, e) message(profile_id, profile_name, level, message, timeout=-1) mount(profileID=None) newSnapshot(snapshot_id, snapshot_path) processBegin() processEnd() unmount(profileID=None)

1.18 progress module class progress.ProgressFile(cfg, filename=None) Bases: configfile.ConfigFile RSYNC = 50 fileReadable() load() Reset current options and load new options from file. Parameters filename (str) – full path save() Save all options to file. Parameters filename (str) – full path Returns True if successful Return type bool

1.19 snapshotlog module class snapshotlog.LogFilter(mode=0, decode=None) Bases: object A Filter for snapshot logs which will both decode log lines and filter them for the requested mode. Parameters • mode (int) – which filter should be used. Possible values: NO_FILTER, ERROR, CHANGES, INFORMATION or ERROR_AND_CHANGES

34 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

• decode (encfstools.Decode) – instance used for decoding lines or None CHANGES = 2 ERROR = 1 ERROR_AND_CHANGES = 4 INFORMATION = 3 NO_FILTER = 0 REGEX = {0: None, 1: re.compile('^(?:\\[E\\]|[^\\[])'), None: None, 3: re.compile('^(?:\\[I\\]|[^\\[])'), 4: re.compile('^(?:\\[E\\]|\\[C\\]|[^\\[])'), 2: re.compile('^(?:\\[C\\]|[^\\[])')} filter(line) Filter and decode line with predefined mode and decode instance. Parameters line (str) – log line read from disk Returns decoded line or None if the line was filtered Return type str class snapshotlog.SnapshotLog(cfg, profile=None) Bases: object Read and write Snapshot log to “~/.local/share/backintime/takesnapshot_.log”. Where is the profile ID profile. Parameters • cfg (config.Config) – current config • profile (int) – profile that should be used to indentify the log ALL = 3 CHANGES_AND_ERRORS = 2 ERRORS = 1 NONE = 0 append(msg, level) Append msg to the log if level is lower than configured log level. Parameters • msg (str) – message line that should be added to the log • level (int) – verbosity level of current line. msg will only be added to log if level is lower than configured log level config.Config.logLevel(). Posi- ble Values: SnapshotLog.ERRORS, SnapshotLog.CHANGES_AND_ERRORS or SnapshotLog.ALL flush() Force write log to file. get(mode=None, decode=None, skipLines=0) Read the log, filter and decode it and yield its lines. Parameters • mode (int) – Mode used for filtering. Take a look at snapshotlog.LogFilter • decode (encfstools.Decode) – instance used for decoding lines or None

1.19. snapshotlog module 35 Back In Time Development Documentation, Release 1.1.12

• skipLines (int) – skip n lines before yielding lines. This is used to append only new lines to LogView Yields str – filtered and decoded log lines new(date) Create a new log file or - if the last new_snapshot can be continued - add a note to the current log. Parameters date (datetime.datetime) – current date

1.20 snapshots module class snapshots.FileInfoDict Bases: dict A dict that maps a path (as bytes) to a tuple (int, bytes, bytes). class snapshots.GenericNonSnapshot(date, cfg) Bases: snapshots.SID displayID **Snapshot ID in a user-readable format* – YYYY-MM-DD HH* – MM:SS Returns formated sID Return type str displayName Combination of displayID, name and error indicator (if any) Returns name Return type str tag Snapshot ID’s tag Returns tag (last three digits) Return type str withoutTag Snapshot ID without tag Returns YYYYMMDD-HHMMSS Return type str class snapshots.NewSnapshot(cfg) Bases: snapshots.GenericNonSnapshot Snapshot ID object for ‘new_snapshot’ folder Parameters cfg (config.Config) – current config NEWSNAPSHOT = 'new_snapshot' SAVETOCONTINUE = 'save_to_continue' hasChanges Check if there where changes in previous sessions. Returns True if there where changes Return type bool

36 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

name Name of this snapshot Returns name of this snapshot Return type str saveToContinue Check if ‘save_to_continue’ flag is set Parameters enable (bool) – set or remove flag Returns True if flag is set Return type bool class snapshots.RootSnapshot(cfg) Bases: snapshots.GenericNonSnapshot Snapshot ID for the filesystem root folder (‘/’) Parameters cfg (config.Config) – current config name Name of this snapshot Returns name of this snapshot Return type str path(*path, use_mode=[]) Current path of this snapshot automatically altered for remote/encrypted version of this path Parameters • *path (str) – one or more folder/files to join at the end of the path. • use_mode (list) – list of modes that should alter this path. If the current mode is in this list, the path will automatically altered for the remote/encrypted version of this path. Returns full snapshot path Return type str class snapshots.SID(date, cfg) Bases: object Snapshot ID object used to gather all information for a snapshot Parameters • date (str, datetime.date or datetime.datetime) – used for creating this snap- shot. str must be in snapshot ID format (e.g 20151218-173512-123) • cfg (config.Config) – current config Raises • ValueError – if date is str instance and doesn’t match the snapshot ID format (20151218-173512-123 or 20151218-173512) • TypeError – if date is not str, datetime.date or datetime.datetime type FAILED = 'failed' FILEINFO = 'fileinfo.bz2' INFO = 'info'

1.20. snapshots module 37 Back In Time Development Documentation, Release 1.1.12

LOG = 'takesnapshot.log.bz2' NAME = 'name' canOpenPath(path) True if path is a file inside this snapshot Parameters path (str) – path from local filesystem (no snapshot path) Returns True if file exists Return type bool displayID **Snapshot ID in a user-readable format* – YYYY-MM-DD HH* – MM:SS Returns formated sID Return type str displayName Combination of displayID, name and error indicator (if any) Returns name Return type str exists() True if the snapshot folder and the “backup” folder inside exist Returns True if exists Return type bool failed This snapshot has failed Parameters enable (bool) – set or remove flag Returns True if flag is set Return type bool fileInfo Load/save “fileinfo.bz2” Parameters d (FileInfoDict) – dict of: {path: (permission, user, group)} Returns dict of: {path: (permission, user, group)} Return type FileInfoDict info Load/save “info” file which contains additional information about this snapshot (using config- file.ConfigFile) Parameters i (configfile.ConfigFile) – info that should be saved. Returns snapshots information Return type configfile.ConfigFile lastChecked Date when snapshot has finished last time. This can be the end of creation of this snapshot or the last time when this snapshot was checked against source without changes. Returns date and time of last check (YYYY-MM-DD HH:MM:SS)

38 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Return type str log(mode=None, decode=None) Load log from “takesnapshot.log.bz2” Parameters • mode (int) – Mode used for filtering. Take a look at snapshotlog.LogFilter • decode (encfstools.Decode) – instance used for decoding lines or None Yields str – filtered and decoded log lines makeDirs(*path) Create snapshot directory Parameters *path (str) – one or more folder/files to join at the end of the path Returns True if successful Return type bool makeWritable() Make the snapshot path writable so we can change files inside Returns True if successful Return type bool name Name of this snapshot Parameters name (str) – new name of the snapshot Returns name of this snapshot Return type str path(*path, use_mode=[]) Current path of this snapshot automatically altered for remote/encrypted version of this path Parameters • *path (str) – one or more folder/files to join at the end of the path. • use_mode (list) – list of modes that should alter this path. If the current mode is in this list, the path will automatically altered for the remote/encrypted version of this path. Returns full snapshot path Return type str pathBackup(*path, **kwargs) ‘backup’ folder inside snapshots path Parameters • *path (str) – one or more folder/files to join at the end of the path. • use_mode (list) – list of modes that should alter this path. If the current mode is in this list, the path will automatically altered for the remote/encrypted version of this path. Returns full snapshot path Return type str

1.20. snapshots module 39 Back In Time Development Documentation, Release 1.1.12

setLastChecked() Set info files atime to current time to indicate this snapshot was checked against source without changes right now. setLog(log) Write log to “takesnapshot.log.bz2” Parameters log – full snapshot log split() Split self.sid into a tuple of int’s with Year, Month, Day, Hour, Minute, Second Returns tuple of 6 int Return type tuple tag Snapshot ID’s tag Returns tag (last three digits) Return type str withoutTag Snapshot ID without tag Returns YYYYMMDD-HHMMSS Return type str class snapshots.Snapshots(cfg=None) Bases: object Collection of take-snapshot and restore commands. Parameters cfg (config.Config) – current config GLOBAL_FLOCK = '/tmp/backintime.lock' SNAPSHOT_VERSION = 3 backup(force=False) Wrapper for takeSnapshot() which will prepair and clean up things for the main takeSnapshot() method. This will check that no other snapshots are running at the same time, there is nothing prohibing a new snapshot (e.g. on battery) and the profile is configured correctly. This will also mount and unmount remote destinations. Parameters force (bool) – force taking a new snapshot even if the profile is not scheduled or the machine is running on battery Returns True if successful created a new snapshot Return type bool backupConfig(sid) Backup the config file to the snapshot and to the backup root if backup is encrypted. Parameters sid (SID) – snapshot in which the config should be stored backupInfo(sid) Save infos about the snapshot into the ‘info’ file. Parameters sid (SID) – snapshot that should get an info file

40 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

backupPermissions(sid) Save permissions (owner, group, read-, write- and executable) for all files in Snapshot sid into snapshots fileInfoDict. Parameters sid (SID) – snapshot that should be scanned backupPermissionsCallback(line, user_data) Rsync callback for Snapshots.backupPermissions(). Parameters • line (bytes) – output from rsync command • user_data (tuple) – two item tuple of (FileInfoDict, encfstools.Decode) backupSuffix() Get suffix for backup files. Returns backup suffix in form of ‘.backup.YYYYMMDD’ Return type str busy() clearIdCache() Reset the cache for UIDs and GIDs. clearNameCache() Reset the cache for user and group names. clearTakeSnapshotMessage() collectPermission(fileinfo, path) Collect permission infos about path and store them into fileinfo. Parameters • fileinfo (FileInfoDict) – dict of: {path: (permission, user, group)} Using sidee- fect on changing dict item will change original dict, too. • path (bytes) – full path to file or folder createLastSnapshotSymlink(sid) Create symlink ‘last_snapshot’ to snapshot sid Parameters sid (SID) – snapshot that should be linked. Returns True if successful Return type bool decMonth(date) First day of previous month of date with respect on previous years. So if date is January this will return 1st of December previous year. Parameters date (datetime.date) – old date that should be decreased Returns 1st day of previous month Return type datetime.date deletePath(sid, path) Delete path and all files and folder inside in snapshot sid. Parameters • sid (SID) – snapshot ID in which path should be deleted

1.20. snapshots module 41 Back In Time Development Documentation, Release 1.1.12

• path (str) – path to delete filter(base_sid, base_path, snapshotsList, list_diff_only=False, flag_deep_check=False, list_equal_to=”) Filter snapshots from snapshotsList based on whether base_path file is included and optional if the snapshot is unique or equal to list_equal_to. Parameters • base_sid (SID) – snapshot ID that contained the original file base_path • base_path (str) – path to file on root filesystem. • snapshotsList (list) – List of SID objects that should be filtered • list_diff_only (bool) – if True only return unique snapshots. Which means if a file is exactly the same in different snapshots only the first snapshot will be listed • flag_deep_check (bool) – use md5sum to check uniqueness of files. More acurate but slow • list_equal_to (str) – full path to file. If not empty only return snapshots which have exactly the same file as this file Returns filtered list of SID objects Return type list filterRsyncProgress(line) Filter rsync’s stdout for progress informations and store them in ‘~/.lo- cal/share/backintime/worker.progress’ file. Parameters line (str) – stdout line from rsync Returns line if it had no progress infos. None if line was a progress Return type str flockExclusive() Block backup() from other profiles or users and run them serialized flockRelease() Release lock so other snapshots can continue freeSpace(now) Remove old snapshots on based on different rules (only if enabled). First rule is to remove snapshots older than X years. Next will call smartRemove() to remove snapshots based on configurable intervals. Third rule is to remove the oldest snapshot until there is enough free space. Last rule will remove the oldest snapshot until there are enough free inodes. ‘last_snapshot’ symlink will be fixed when done. Parameters now (datetime.datetime) – date and time when takeSnapshot was started gid(name, callback=None, backup=None) Get the Group identifier (GID) for the group in name. name->gid will be cached to speed up subsequent requests. Parameters • name (str, bytes) – groupname to search for • callback (method) – callable which will handle a given message • backup (int) – GID wich will be used if the groupname is unknown on this machine

42 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Returns GID of the group in name or -1 if not found Return type int groupName(gid) Get the groupname for the given gid. gid->name will be cached to speed up subsequent requests. Parameters gid (int) – Group identifier (GID) to search for Returns name of the Group with GID gid or ‘.’ if not found Return type str incMonth(date) First day of next month of date with respect on new years. So if date is December this will return 1st of January next year. Parameters date (datetime.date) – old date that should be increased Returns 1st day of next month Return type datetime.date makeDirs(path) Wrapper for tools.makeDirs(). Create directories path recursive and return success. If not suc- cessful send error-message to log. Parameters path (str) – fullpath to directories that should be created Returns True if successful Return type bool pid() remove(sid) Remove snapshot sid. Parameters sid (SID) – snapshot to remove restore(sid, paths, callback=None, restore_to=”, delete=False, backup=True, only_new=False) Restore one or more files from snapshot sid to either original or a different destination. Restore is done with rsync. If available permissions will be restored from fileinfo.bz2. Parameters • sid (SID) – snapshot from whom to restore • paths (list, tuple or str) – single path (str) or multiple paths (list, tuple) that should be restored. For every path this will run a new rsync process. Permissions will be restored for all paths in one run • callback (method) – callable instance which will handle messages • restore_to (str) – full path to restore to. If empty restore to original destiantion • delete (bool) – delete newer files which are not in the snapshot • backup (bool) – create backup files (*.backup.YYYYMMDD) before changing or deleting local files. • only_new (bool) – Only restore files which does not exist or are newer than those in destination. Using “rsync –update” option. restoreCallback(callback, ok, msg) Format messages thrown by restore depending on whether they where successful or failed.

1.20. snapshots module 43 Back In Time Development Documentation, Release 1.1.12

Parameters • callback (method) – callable instance which will handle the message • ok (bool)– True if the logged action was successful or False if it failed • msg (str) – message that should be send to callback restorePermission(key_path, path, fileInfoDict, callback=None) Restore permissions (owner, group and mode). If permissions are already identical with the new ones just skip. Otherwise try to ‘chown’ to new owner and new group. If that fails (most probably because we are not running as root and normal user has no rights to change ownership of files) try to at least ‘chgrp’ to the new group. Finally ‘’ the new mode. Parameters • key_path (bytes) – original path during backup. Same as in fileInfoDict. • path (bytes) – current path of file that should be changed. • fileInfoDict (FileInfoDict) – FileInfoDict rsyncCallback(line, params) Parse rsync’s stdout, send it to takeSnapshotMessage and takeSnapshotLog. Also check if there has been changes or errors in current rsync. Parameters • line (str) – stdout line from rsync • params (list) – list of two bool ‘[error, changes]’. Using siteefect on changing list items will change original list, too. If rsync reported an error params[0] will be set to True. If rsync reported a changed file params[1] will be set to True rsyncExclude(excludeFolders=None) Format exclude list for rsync Parameters excludeFolders (list) – list of folders to exclude Returns rsync exclude options Return type OrderedSet rsyncInclude(includeFolders=None) Format include list for rsync. Returns a tuple of two include strings. First string need to come before exclude, second after exclude. Parameters includeFolders (list) – folders to include. list of tuples (item, int) where int is 0 if item is a folder or 1 if item is a file Returns two item tuple of (OrderedSet('include1 opions'), OrderedSet('include2 options')) Return type tuple rsyncRemotePath(path, use_mode=[’ssh’, ’ssh_encfs’], quote=’"’) Format the destination string for rsync depending on which profile is used. Parameters • path (str) – destination path • use_mode (list) – list of modes in which the result should change to user@host:path instead of just path

44 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

• quote (str) – use this to quote the path Returns quoted path like ‘”/foo”’ or if the current mode is using ssh and current mode is in use_mode a combination of user, host and path like ‘’user@host:”/foo”’‘ Return type str rsyncSuffix(includeFolders=None, excludeFolders=None) Create suffixes for rsync. Parameters • includeFolders (list) – folders to include. list of tuples (item, int) Where int is 0 if item is a folder or 1 if item is a file • excludeFolders (list) – list of folders to exclude Returns rsync include and exclude options Return type list setTakeSnapshotMessage(type_id, message, timeout=-1) smartRemove(del_snapshots, log=None) Remove multiple snapshots either with Snapshots.remove() or in background on the remote host if mode is ssh or ssh_encfs and smart-remove in background is activated. Parameters • del_snapshots (list) – list of SID that should be removed • log (method) – callable method that will handle progress log smartRemoveKeepAll(snapshots, min_date, max_date) Return all snapshots between min_date and max_date. Parameters • snapshots (list) – full list of SID objects • min_date (datetime.date) – minimum date for snapshots to keep • max_date (datetime.date) – maximum date for snapshots to keep Returns set of snapshots that should be keept Return type set smartRemoveKeepFirst(snapshots, min_date, max_date, keep_healthy=False) Return only the first snapshot between min_date and max_date. Parameters • snapshots (list) – full list of SID objects • min_date (datetime.date) – minimum date for snapshots to keep • max_date (datetime.date) – maximum date for snapshots to keep • keep_healthy (bool) – return the first healthy snapshot (not marked as failed) instead of the first at all. If all snapshots failed this will again return the very first snapshot Returns set of snapshots that should be keept Return type set

1.20. snapshots module 45 Back In Time Development Documentation, Release 1.1.12

smartRemoveList(now_full, keep_all, keep_one_per_day, keep_one_per_week, keep_one_per_month) Get a list of old snapshots that should be removed based on configurable intervals. Parameters • now_full (datetime.datetime) – date and time when takeSnapshot was started • keep_all (int) – keep all snapshots for the last keep_all days • keep_one_per_day (int) – keep one snapshot per day for the last keep_one_per_day days • keep_one_per_week (int) – keep one snapshot per week for the last keep_one_per_week weeks • keep_one_per_month (int) – keep one snapshot per month for the last keep_one_per_month months Returns snapshots that should be removed Return type list statFreeSpaceLocal(path) Get free space on filsystem containing path in MiB using os.statvfs(). Depending on remote SFTP server this might fail on sshfs mounted shares. Parameters path (str) – full path Returns int free space in MiB statFreeSpaceSsh() Get free space on remote filsystem in MiB. This will call df on remote host and parse its output. Returns int free space in MiB takeSnapshot(sid, now, include_folders) This is the main backup routine. It will take a new snapshot and store permissions of included files and folders into fileinfo.bz2. Parameters • sid (SID) – snapshot ID which the new snapshot should get • now (datetime.datetime) – date and time when this snapshot was started • include_folders (list) – folders to include. list of tuples (item, int) where int is 0 if item is a folder or 1 if item is a file Returns list of two bool (ret_val, ret_error) where ret_val is True if a new snapshot has been created and ret_error is True if there was an error during taking the snapshot Return type list takeSnapshotMessage() uid(name, callback=None, backup=None) Get the User identifier (UID) for the user in name. name->uid will be cached to speed up subsequent requests. Parameters • name (str, bytes) – username to search for • callback (method) – callable which will handle a given message

46 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

• backup (int) – UID wich will be used if the username is unknown on this machine Returns UID of the user in name or -1 if not found Return type int userName(uid) Get the username for the given uid. uid->name will be cached to speed up subsequent requests. Parameters uid (int) – User identifier (UID) to search for Returns name of the user with UID uid or ‘-‘ if not found Return type str snapshots.iterSnapshots(cfg, includeNewSnapshot=False) Iterate over snapshots in current snapshot path. Use this in a ‘for’ loop for faster processing than list object Parameters • cfg (config.Config) – current config • includeNewSnapshot (bool) – include a NewSnapshot instance if ‘new_snapshot’ folder is available. Yields SID – snapshot IDs snapshots.lastSnapshot(cfg) Most recent snapshot. Parameters cfg (config.Config) – current config (config.Config instance) Returns most recent snapshot ID Return type SID snapshots.listSnapshots(cfg, includeNewSnapshot=False, reverse=True) List of snapshots in current snapshot path. Parameters • cfg (config.Config) – current config (config.Config instance) • includeNewSnapshot (bool) – include a NewSnapshot instance if ‘new_snapshot’ folder is available • reverse (bool) – sort reverse Returns list of SID objects Return type list

1.21 sshMaxArg module sshMaxArg.maxArgLength(config, mid=1048320) sshMaxArg.randomId(size=6, chars=’ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789’) sshMaxArg.reportResult(host, mid) sshMaxArg.reportTest(mid, msg)

1.21. sshMaxArg module 47 Back In Time Development Documentation, Release 1.1.12

1.22 sshtools module class sshtools.SSH(*args, **kwargs) Bases: mount.MountControl This is a backend for the mount API mount.MountControl. This will mount the remote path with sshfs, prepair the remote path and check that everything is set up correctly for Back In Time to run snapshots through SSH. This class will only mount the remote path. The real takeSnapshot process will use rsync over ssh. Other commands run remote over ssh. Parameters • cfg (config.Config) – current config (handled by inherited mount. MountControl) • user (str) – User name on remote host • host (str) – Name or IP Address of remote host • port (int) – Port used by SSHd on remote host • path (str) – remote path where snapshots are stored. Can be either relative from remote users homedir or an absolute path • cipher (str) – Cipher used to encrypt the network transfer • private_key_file (str) – Private key which is able to log on with Public/Private Key-Method on remote host • nice (bool) – use nice -n 19 to run commands with low CPU priority on remote host • ionice (bool) – use ionice -c2 -n7 to run commands with low IO priority on re- mote host • nocache (bool) – use nocache to deactivate RAM caching of files on remote host • password (str) – password to unlock the private key • profile_id (str) – profile ID that should be used (handled by inherited mount. MountControl) • hash_id (str) – crc32 hash used to identify identical mountpoints (handled by inherited mount.MountControl) • tmp_mount (bool) – if True mount to a temporary destination (handled by inherited mount.MountControl) • parent (QWidget) – parent widget for QDialogs or None if there is no parent (handled by inherited mount.MountControl) • symlink (bool) – if True set symlink to mountpoint (handled by inherited mount. MountControl) • mode (str) – one of local, local_encfs, ssh or ssh_encfs (handled by inherited mount.MountControl) • hash_collision (int) – global value used to prevent hash collisions on mountpoints (handled by inherited mount.MountControl)

48 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Note: All Arguments are optional. Default values will be fetched from config.Config. But after changing Settings we need to test the new values before storing them into config.Config. This is why all values will be added as arguments.

_mount() Backend mount method. This will call sshfs to mount the remote path. Raises exceptions.MountException – if mount wasn’t successful benchmarkCipher(size=40) Rudimental benchmark to compare transfer speed of all available ciphers. Parameters size (int) – size of the testfile in MiB checkCipher() Try to login to remote host with the choosen cipher. This should make sure both localhost and the remote host support the choosen cipher. Raises exceptions.MountException – if login with the cipher failed checkKnownHosts() Check if the remote host is in current users known_hosts file. Raises exceptions.KnownHost – if the remote host wasn’t found in known_hosts file checkLogin() Try to login to remote host with public/private-key-method (passwordless). Raises exceptions.NoPubKeyLogin – if login failed checkPingHost() Check if the remote host is online. Other than methods name may let suppose this does not use Ping (ICMP) but try to open a connection to the configured port on the remote host. In this way it will even work on remote hosts which have ICMP disabled. If connection failed it will retry five times before failing. Raises exceptions.MountException – if connection failed most probably because re- mote host is offline checkRemoteCommands(retry=False) Try out all relevant commands used by Back In Time on the remote host to make sure snapshots will be successful with the remote host. This will also check that hard-links are supported on the remote host. This check can be disabled with config.Config.sshCheckCommands() Parameters retry (bool) – retry to run the commands if it failed because the command string was to long Raises exceptions.MountException – if a command is not supported on remote host or if hard-links are not supported checkRemoteFolder() Check the remote path. If the remote path doesn’t exist this will create it. If it already exist this will check, that it is a folder and has correct permissions. Raises exceptions.MountException – if remote path couldn’t be created or doesn’t have correct permissions. preMountCheck(first_run=False) Check that everything is prepaired and ready for successfully mount the remote path. Default is to run a

1.22. sshtools module 49 Back In Time Development Documentation, Release 1.1.12

light version of checks which will only make sure the remote host is online, sshfs is installed and the remote folder is available. After changing settings this should be run with first_run = True to run a full check with all tests. Parameters first_run (bool) – run a full test with all checks Raises exceptions.MountException – if one test failed an we can not mount the remote path randomId(size=6, chars=’ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789’) Create a random string. Parameters • size (int) – length of the string • chars (str) – characters used as basis for the random string Returns random string with lenght size Return type str startSshAgent() Start a new ssh-agent if it is not already running. Raises exceptions.MountException – if starting ssh-agent failed unlockSshAgent(force=False) Unlock the private key in ssh-agent which will provide it for all other commands. The password to unlock the key will be provided by backintime-askpass. Parameters force (bool) – force to unlock the key by removing it first and add it again to make sure, the given values are correct Raises exceptions.MountException – if unlock failed sshtools.sshCopyId(pubkey, user, host, port=’22’, askPass=’backintime-askpass’, cipher=None) Copy SSH public key pubkey to remote host. Parameters • pubkey (str) – path to the public key file • user (str) – remote user • host (str) – remote host • port (str) – ssh port on remote host • askPass (str) – program used to pipe password into ssh • cipher (str) – cipher used for ssh Returns True if successful Return type bool sshtools.sshHostKey(host, port=’22’) Get the remote host key from host. Parameters • host (str) – host name or IP address • port (str) – port number of remote ssh-server Returns three item tuple with (fingerprint, hashed host key, key type)

50 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Return type tuple sshtools.sshKeyFingerprint(path) Get the hex fingerprint from a given ssh key. Parameters path (str) – full path to key file Returns hex fingerprint from key Return type str sshtools.sshKeyGen(keyfile) Generate a new ssh-key pair (private and public key) in keyfile and keyfile.pub Parameters keyfile (str) – path for private key file Returns True if successful; False if keyfile already exist or if there was an error Return type bool sshtools.writeKnownHostsFile(key) Write host key key into ~/.ssh/known_hosts. Parameters key (str) – host key

1.23 tools module class tools.Alarm(callback=None, overwrite=True) Bases: object Timeout for FIFO. This does not work with threading. handler(signum, frame) Timeout occur. start(timeout) Start timer stop() Stop timer before it come to an end class tools.Daemon(pidfile=None, stdin=’/dev/null’, stdout=’/dev/stdout’, stderr=’/dev/null’, umask=18) Bases: object A generic daemon class. Usage: subclass the Daemon class and override the run() method Daemon Copyright by Sander Marechal License CC BY-SA 3.0 http://www.jejik.com/articles/2007/02/a_ simple_unix_linux_daemon_in_python/ cleanupHandler(signum, frame) daemonize() do the double-fork magic, see Stevens’ “Advanced Programming in the UNIX Environment” for details (ISBN 0201563177) http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16 reload() send SIGHUP signal to process

1.23. tools module 51 Back In Time Development Documentation, Release 1.1.12

restart() Restart the daemon run() You should override this method when you subclass Daemon. It will be called after the process has been daemonized by start() or restart(). start() Start the daemon status() return status stop() Stop the daemon class tools.Execute(cmd, callback=None, user_data=None, filters=(), parent=None, conv_str=True, join_stderr=True) Bases: object Execute external commands and handle its output. Parameters • cmd (str or list) – command with arguments that should be called. Depending on if this is str or list instance the command will be called by either os.system() (deprecated) or subprocess.Popen • callback (method) – function which will handle output returned by command • user_data – extra arguments which will be forwarded to callback function • filters (tuple) – Tuple of functions used to filter messages before sending them to callback • parent (instance) – instance of the calling method used only to proper format log messages • conv_str (bool) – convert output to str if True or keep it as bytes if False • join_stderr (bool) – join stderr to stdout

Note: Signals SIGTSTP and SIGCONT send to Python main process will be forwarded to the command. SIGHUP will kill the process.

kill(signum, frame) Slot which will kill the command. Is connected to signal SIGHUP. pause(signum, frame) Slot which will send SIGSTOP to the command. Is connected to signal SIGTSTP. resume(signum, frame) Slot which will send SIGCONT to the command. Is connected to signal SIGCONT. run() Start the command. Returns returncode from command Return type int class tools.OrderedSet(iterable=None) Bases: collections.abc.MutableSet

52 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

OrderedSet from Python recipe http://code.activestate.com/recipes/576694/ add(key) Add an element. discard(key) Remove an element. Do not raise an exception if absent. pop(last=True) Return the popped value. Raise KeyError if empty. class tools.PathHistory(path) Bases: object append(path) next() previous() reset(path) class tools.SetupUdev Bases: object Setup Udev rules for starting BackInTime when a drive get connected. This is done by serviceHelper.py script (included in backintime-qt) running as root though DBus. CONNECTION = 'net.launchpad.backintime.serviceHelper' INTERFACE = 'net.launchpad.backintime.serviceHelper.UdevRules' MEMBERS = ('addRule', 'save', 'delete') OBJECT = '/UdevRules' addRule(cmd, uuid) Prepair rules in serviceHelper.py clean() Clean up remote cache save() Save rules with serviceHelper.py after authentication If no rules where added before this will delete current rule. class tools.ShutDown Bases: object Shutdown the system after the current snapshot has finished. This should work for KDE, Gnome, Unity, Cinna- mon, XFCE, Mate and E17. DBUS_SHUTDOWN = {'e17': {'objectPath': '/org/enlightenment/Remote/RemoteObject', 'method': 'Halt', 'service': 'org.enlightenment.Remote.service', 'arguments': (), 'bus': 'sessionbus', 'interface': 'org.enlightenment.Remote.Core'}, 'e19': {'objectPath': '/org/enlightenment/wm/RemoteObject', 'method': 'Shutdown', 'service': 'org.enlightenment.wm.service', 'arguments': (), 'bus': 'sessionbus', 'interface': 'org.enlightenment.wm.Core'}, 'gnome': {'objectPath': '/org/gnome/SessionManager', 'method': 'Shutdown', 'service': 'org.gnome.SessionManager', 'arguments': (), 'bus': 'sessionbus', 'interface': 'org.gnome.SessionManager'}, 'kde': {'objectPath': '/KSMServer', 'method': 'logout', 'service': 'org.kde.ksmserver', 'arguments': (-1, 2, -1), 'bus': 'sessionbus', 'interface': 'org.kde.KSMServerInterface'}, 'mate': {'objectPath': '/org/mate/SessionManager', 'method': 'Shutdown', 'service': 'org.mate.SessionManager', 'arguments': (), 'bus': 'sessionbus', 'interface': 'org.mate.SessionManager'}, 'xfce': {'objectPath': '/org/xfce/SessionManager', 'method': 'Shutdown', 'service': 'org.xfce.SessionManager', 'arguments': (True,), 'bus': 'sessionbus', 'interface': 'org.xfce.Session.Manager'}, 'z_freed': {'objectPath': '/org/freedesktop/login1', 'method': 'PowerOff', 'service': 'org.freedesktop.login1', 'arguments': (True,), 'bus': 'systembus', 'interface': 'org.freedesktop.login1.Manager'}} _prepair() Try to connect to the given dbus services. If successful it will return a callable dbus proxy and those arguments. askBeforeQuit() Indicate if ShutDown is ready to fire and so the application shouldn’t be closed. canShutdown() Indicate if a valid dbus service is available to shutdown system. shutdown() Run ‘shutdown -h now’ if we are root or call the dbus proxy to start the shutdown.

1.23. tools module 53 Back In Time Development Documentation, Release 1.1.12

unity7() Unity >= 7.0 doesn’t shutdown automatically. It will only show shutdown dialog and wait for user input. class tools.UniquenessSet(dc=False, follow_symlink=False, list_equal_to=”) Bases: object Check for uniqueness or equality of files. Parameters • dc (bool) – if True use deep check which will compare files md5sums if they are of same size but no hardlinks (don’t have the same inode). If False use files size and mtime • follow_symlink (bool) – if True check symlinks target instead of the link • list_equal_to (str) – full path to file. If not empty only return equal files to the given path instead of unique files. check(input_path) Check file input_path for either uniqueness or equality (depending on list_equal_to from con- structor). Parameters input_path (str) – full path to file Returns True if file is unique and list_equal_to is empty. Or True if file is equal to file in list_equal_to Return type bool checkEqual(path) Check if path is equal to the file in list_equal_to from constructor. Parameters path (str) – full path to file Returns True if file is equal Return type bool checkUnique(path) Check file path for uniqueness and store a unique key for path. Parameters path (str) – full path to file Returns True if file is unique Return type bool tools.addSourceToPathEnviron() Add ‘backintime/common’ path to ‘PATH’ environ variable. tools.backintimePath(*path) Get path inside ‘backintime’ install folder. Parameters *path (str) – paths that should be joind to ‘backintime’ Returns ‘backintime’ child path like:

/usr/share/backintime/common /usr/share/backintime/qt

Return type str

54 Chapter 1. common Back In Time Development Documentation, Release 1.1.12 tools.camelCase(s) Remove underlines and make every first char uppercase. Parameters s (str) – string separated by underlines (foo_bar) Returns string without underlines but uppercase chars (FooBar) Return type str tools.checkCommand(cmd) Check if command cmd is a file in ‘PATH’ environ. Parameters cmd (str) – command Returns True if command cmd is in ‘PATH’ environ Return type bool tools.checkCronPattern(s) Check if s is a valid cron pattern. Examples:

0,10,13,15,17,20,23 */6

Parameters s (str) – pattern to check Returns True if s is a valid cron pattern Return type bool tools.checkHomeEncrypt() Return True if users home is encrypted tools.checkXServer() Check if there is a X11 server running on this system. Returns True if X11 server is running Return type bool tools.decodeOctalEscape(s) Decode octal-escaped characters with its ASCII dependance. For example ‘ ‘ will be a space ‘ ‘ Parameters s (str) – string with or without octal-escaped characters Returns human readable string Return type str tools.device(path) Get the device for the filesystem of path. Example:

/dev/sda1 /dev/mapper/vglinux proc

Parameters path (str) – full path Returns device Return type str tools.envLoad(f ) Load environ variables from file f into current environ. Do not overwrite existing environ variables.

1.23. tools module 55 Back In Time Development Documentation, Release 1.1.12

Parameters f (str) – full path to file with environ variables tools.envSave(f ) Save environ variables to file that are needed by cron to connect to keyring. This will only work if the user is logged in. Parameters f (str) – full path to file for environ variables tools.escapeIPv6Address(address) Escape IPv6 Addresses with square brackets []. Parameters address (str) – address that should be escaped Returns address in square brackets Return type str tools.fdDup(old, new_fd, mode=’w’) Duplicate file descriptor old to new_fd and closing the latter first. Used to redirect stdin, stdout and stderr from daemonized threads. Parameters • old (str) – Path to the old file (e.g. /dev/stdout) • new_fd (_io.TextIOWrapper) – file object for the new file • mode (str) – mode in which the old file should be opened tools.filesystem(path) Get the filesystem type for the filesystem of path. Parameters path (str) – full path Returns filesystem Return type str tools.filesystemMountInfo() Get a dict of mount point string -> dict of filesystem info for entire system. Returns {MOUNTPOINT: {‘original_uuid’: UUID}} Return type dict tools.gitRevisionAndHash() Get the current Git Branch and the last HashID (shot form) if running from source. Returns two items of either str instance if running from source or None Return type tuple tools.inhibitSuspend(app_id=’/home/docs/checkouts/readthedocs.org/user_builds/backintime- dev/envs/latest/bin/sphinx-build’, toplevel_xid=None, reason=’take snapshot’, flags=12) Prevent machine to go to suspend or hibernate. Returns the inhibit cookie which is used to end the inhibitor. tools.isIPv6Address(address) Check if address is a valid IPv6 address. Parameters address (str) – address that should get tested Returns True if address is a valid IPv6 address Return type bool

56 Chapter 1. common Back In Time Development Documentation, Release 1.1.12 tools.isRoot() Check if we are root. Returns True if we are root Return type bool tools.keyringSupported() tools.makeDirs(path) Create directories path recursive and return success. Parameters path (str) – fullpath to directories that should be created Returns True if successful Return type bool tools.md5sum(path) Calculate md5sum for file in path. Parameters path (str) – full path to file Returns md5sum of file Return type str tools.mkdir(path, mode=493) Create directory path. Parameters • path (str) – full path to directory that should be created • mode (int) – numeric permission mode Returns True if successful Return type bool tools.mountArgs(path) Get all /etc/mtab args for the filesystem of path as a list. Example:

[DEVICE, MOUNTPOINT, FILESYSTEM_TYPE, OPTIONS, DUMP, PASS] ['/dev/sda3','/','','defaults','0','0'] ['/dev/sda1','/boot','ext4','defaults','0','0']

Parameters path (str) – full path Returns mount args Return type list tools.mountpoint(path) Get the mountpoint of path. If your HOME is on a separate partition mountpoint(‘/home/user/foo’) would return ‘/home’. Parameters path (str) – full path Returns mountpoint of the filesystem Return type str tools.onBattery() Checks if the system is on battery power.

1.23. tools module 57 Back In Time Development Documentation, Release 1.1.12

Returns True if system is running on battery Return type bool tools.password(*args) tools.patternHasNotEncryptableWildcard(pattern) Check if pattern has wildcards []? *. but return False for foo/*, foo/*/bar, */bar or **/bar Parameters pattern (str) – path or pattern to check Returns True if pattern has wildcards []? * but False if wildcard look like foo/*, foo/ */bar, */bar or **/bar Return type bool tools.pids() List all PIDs currently running on the system. Returns PIDs as int Return type list tools.pidsWithName(name) Get all processes currently running with name name. Parameters name (str) – name of a process like ‘python3’ or ‘backintime’ Returns PIDs as int Return type list tools.powerStatusAvailable() Check if org.freedesktop.UPower is available so that tools.onBattery() would return the correct power status. Returns True if tools.onBattery() can report power status Return type bool tools.preparePath(path) Removes trailing slash ‘/’ from path. Parameters path (str) – absolut path Returns path path without trailing but with leading slash Return type str tools.processAlive(pid) Check if the process with PID pid is alive. Parameters pid (int) – Process Indicator Returns True if the process with PID pid is alive Return type bool Raises ValueError – If pid is 0 because ‘kill(0, SIG)’ would send SIG to all processes tools.processCmdline(pid) Get the cmdline (command that spawnd this process) of the process with pid. Parameters pid (int) – Process Indicator Returns cmdline of the process

58 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Return type str tools.processExists(name) Check if process name is currently running. Parameters name (str) – name of a process like ‘python3’ or ‘backintime’ Returns True if there is a process running with name Return type bool tools.processName(pid) Get the name of the process with pid. Parameters pid (int) – Process Indicator Returns name of the process Return type str tools.processPaused(pid) Check if process pid is paused (got signal SIGSTOP). Parameters pid (int) – Process Indicator Returns True if process is paused Return type bool tools.processStat(pid) Get the stat’s of the process with pid. Parameters pid (int) – Process Indicator Returns stat from /proc/PID/stat Return type str tools.readCrontab() Read users crontab. Returns crontab lines Return type list tools.readFile(path, default=None) Read the file in path or its ‘.gz’ compressed variant and return its content or default if path does not exist. Parameters • path (str) – full path to file that should be read. ‘.gz’ will be added automatically if the file is compressed • default (str) – default if path does not exist Returns content of file in path Return type str tools.readFileLines(path, default=None) Read the file in path or its ‘.gz’ compressed variant and return its content as a list of lines or default if path does not exist. Parameters • path (str) – full path to file that should be read. ‘.gz’ will be added automatically if the file is compressed

1.23. tools module 59 Back In Time Development Documentation, Release 1.1.12

• default (list) – default if path does not exist Returns content of file in path splitted by lines. Return type list tools.readTimeStamp(fname) Read date string from file fname and try to return datetime. Parameters fname (str) – full path to timestamp file Returns date from timestamp file Return type datetime.datetime tools.registerBackintimePath(*path) Add BackInTime path path to sys.path so subsequent imports can discover them. Parameters *path (str) – paths that should be joind to ‘backintime’

Note: Duplicate in qt/qttools.py() because modules in qt folder would need this to actually import tools. tools.rsyncCaps(data=None) Get capabilities of the installed rsync binary. This can be different from version to version and also on build arguments used when building rsync. Parameters data (str) – ‘rsync –version’ output. This is just for unittests. Returns List of str with rsyncs capabilities Return type list tools.rsyncPrefix(config, no_perms=True, use_mode=[’ssh’, ’ssh_encfs’], progress=True) Get rsync command and all args for creating a new snapshot. Args are based on current profile in config. Parameters • config (config.Config) – current config • no_perms (bool) – don’t sync permissions (–no-p –no-g –no-o) if True. config. Config.preserveAcl() == True or config.Config.preserveXattr() == True will overwrite this to False • use_mode (list) – if current mode is in this list add additional args for that mode • progress (bool) – add ‘–info=progress2’ to show progress Returns rsync command with all args but without –include, –exclude, source and destination Return type list tools.rsyncRemove(config, run_local=True) Get rsync command and all args for removing snapshots with rsync. Parameters • config (config.Config) – current config • run_local (bool) – if True and current mode is ssh or ssh_encfs this will add SSH options Returns rsync command with all args

60 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Return type list tools.rsyncSshArgs(config, use_mode=[’ssh’, ’ssh_encfs’]) Get SSH args for rsync based on current profile in config. Parameters • config (config.Config) – current config • use_mode (list) – if current mode is in this list add additional args for that mode Returns SSH args for rsync Return type list tools.runningFromSource() Check if BackInTime is running from source (without installing). Returns True if BackInTime is running from source Return type bool tools.setPassword(*args) tools.sharePath() Get BackInTimes installation base path. If running from source return default ‘/usr/share’ Returns share path like:

/usr/share /usr/local/share /opt/usr/share

Return type str tools.splitCommands(cmds, head=”, tail=”, maxLength=0) Split a list of commands cmds into multiple commands with each length lower than maxLength. Parameters • cmds (list) – commands • head (str) – command that need to run first on every iteration of cmds • tail (str) – command that need to run after every iteration of cmds • maxLength (int) – maximum length a command could be. Don’t split if <= 0 Yields str – new command with length < maxLength Example:

head cmds[0] cmds[n] tail

tools.syncfs() Sync any data buffered in memory to disk. Returns True if successful Return type bool tools.tempFailureRetry(func, *args, **kwargs)

1.23. tools module 61 Back In Time Development Documentation, Release 1.1.12 tools.unInhibitSuspend(cookie, bus, dbus_props) Release inhibit. tools.usingSudo() Check if ‘sudo’ was used to start this process. Returns True if process was started with sudo Return type bool tools.uuidFromDev(dev) Get the UUID for the block device dev. Parameters dev (str) – block device path Returns UUID Return type str tools.uuidFromPath(path) Get the UUID for the for the filesystem of path. Parameters path (str) – full path Returns UUID Return type str tools.which(cmd) Get the fullpath of executable command cmd. Works like command-line ‘which’ command. Parameters cmd (str) – command Returns fullpath of command cmd or None if command is not available Return type str tools.wrapLine(msg, size=950, delimiters=’\t ’, new_line_indicator=’CONTINUE: ’) Wrap line msg into multiple lines with each shorter than size. Try to break the line on delimiters. New lines will start with new_line_indicator. Parameters • msg (str) – string that should get wrapped • size (int) – maximum lenght of returned strings • delimiters (str) – try to break msg on these characters • new_line_indicator (str) – start new lines with this string Yields str – lines with max size lenght tools.writeCrontab(lines) Write to users crontab.

Note: This will overwrite the whole crontab. So to keep the old crontab and only add new entries you need to read it first with tools.readCrontab(), append new entries to the list and write it back.

Parameters lines (list, tuple) – lines that should be written to crontab Returns True if successful

62 Chapter 1. common Back In Time Development Documentation, Release 1.1.12

Return type bool tools.writeTimeStamp(fname) Write current date and time into file fname. Parameters fname (str) – full path to timestamp file

1.23. tools module 63 Back In Time Development Documentation, Release 1.1.12

64 Chapter 1. common CHAPTER 2

Indices and tables

• genindex • modindex • search

65 Back In Time Development Documentation, Release 1.1.12

66 Chapter 2. Indices and tables Python Module Index

a sshMaxArg, 47 applicationinstance,3 sshtools, 48 askpass,4 t b tools, 51 backintime,4 bcolors,7 c cli,7 config,8 configfile, 15 d driveinfo, 21 dummytools, 21 e encfstools, 22 exceptions, 23 g guiapplicationinstance, 24 l logger, 24 m mount, 25 p password, 32 password_ipc, 33 pluginmanager, 33 progress, 34 s snapshotlog, 34 snapshots, 36

67 Back In Time Development Documentation, Release 1.1.12

68 Python Module Index Index

Symbols askBeforeQuit() (tools.ShutDown method), 53 _mount() (dummytools.Dummy method), 21 askpass (module),4 _mount() (encfstools.EncFS_mount method), 23 askQuestion() (configfile.ConfigFile method), 15 _mount() (in module backintime),4 AT_EVERY_BOOT (config.Config attribute),8 _mount() (mount.MountControl method), 27 authors() (config.Config method),9 _mount() (sshtools.SSH method), 49 _prepair() (tools.ShutDown method), 53 B _umount() (dummytools.Dummy method), 21 backintime (module),4 _umount() (in module backintime),4 BackInTimeException, 23 _umount() (mount.MountControl method), 27 backintimePath() (in module tools), 54 backup() (in module backintime),4 A backup() (snapshots.Snapshots method), 40 add() (tools.OrderedSet method), 53 backupConfig() (encfstools.EncFS_mount method), 23 addProfile() (configfile.ConfigFileWithProfiles method), backupConfig() (snapshots.Snapshots method), 40 18 backupInfo() (snapshots.Snapshots method), 40 addRule() (tools.SetupUdev method), 53 backupJob() (in module backintime),4 addSourceToPathEnviron() (in module tools), 54 BackupJobDaemon (class in cli),7 Alarm (class in tools), 51 backupOnRestore() (config.Config method),9 aliasParser() (in module backintime),4 backupPermissions() (snapshots.Snapshots method), 40 ALL (snapshotlog.SnapshotLog attribute), 35 backupPermissionsCallback() (snapshots.Snapshots anacronJobIdentify() (config.Config method),9 method), 41 anacronSpool() (config.Config method),9 backupScheduled() (config.Config method),9 anacronSpoolFile() (config.Config method),9 backupSuffix() (snapshots.Snapshots method), 41 anacrontab() (config.Config method),9 bcolors (module),7 anacrontabFiles() (config.Config method),9 benchmarkCipher() (in module backintime),5 APP_NAME (config.Config attribute),8 benchmarkCipher() (sshtools.SSH method), 49 append() (configfile.ConfigFile method), 15 boolValue() (configfile.ConfigFile method), 15 append() (configfile.ConfigFileWithProfiles method), 18 Bounce (class in encfstools), 22 append() (snapshotlog.SnapshotLog method), 35 busy() (applicationinstance.ApplicationInstance method), append() (tools.PathHistory method), 53 3 appExit() (pluginmanager.Plugin method), 33 busy() (snapshots.Snapshots method), 41 appExit() (pluginmanager.PluginManager method), 34 bwlimit() (config.Config method),9 appInstanceFile() (config.Config method),9 bwlimitEnabled() (config.Config method),9 ApplicationInstance (class in applicationinstance),3 applicationinstance (module),3 C appPath() (config.Config method),9 callback() (cli.RestoreDialog method),7 appStart() (pluginmanager.Plugin method), 33 camelCase() (in module tools), 54 appStart() (pluginmanager.PluginManager method), 34 canBackup() (config.Config method),9 argParse() (in module backintime),4 canOpenPath() (snapshots.SID method), 38

69 Back In Time Development Documentation, Release 1.1.12 canShutdown() (tools.ShutDown method), 53 CONFIG_VERSION (config.Config attribute),8 changelog() (config.Config method),9 ConfigFile (class in configfile), 15 changeProfile() (in module logger), 24 configfile (module), 15 CHANGES (snapshotlog.LogFilter attribute), 35 configFile() (encfstools.EncFS_mount method), 23 CHANGES_AND_ERRORS (snapshotlog.SnapshotLog ConfigFileWithProfiles (class in configfile), 18 attribute), 35 CONNECTION (tools.SetupUdev attribute), 53 check() (applicationinstance.ApplicationInstance continueOnErrors() (config.Config method),9 method),3 copyLinks() (config.Config method),9 check() (guiapplicationinstance.GUIApplicationInstance COPYRIGHT (config.Config attribute),8 method), 24 copyUnsafeLinks() (config.Config method),9 check() (tools.UniquenessSet method), 54 create() (password_ipc.FIFO method), 33 CHECK_FUSE_GROUP (mount.MountControl at- createLastSnapshotSymlink() (snapshots.Snapshots tribute), 27 method), 41 checkCipher() (sshtools.SSH method), 49 createMountStructure() (mount.MountControl method), checkCommand() (in module tools), 55 28 checkConfig() (config.Config method),9 createNewCrontab() (config.Config method),9 checkConfig() (in module backintime),5 createParsers() (in module backintime),5 checkConfig() (in module cli),8 cronCmd() (config.Config method),9 checkCronPattern() (in module tools), 55 cronEnvFile() (config.Config method), 10 checkEqual() (tools.UniquenessSet method), 54 cronLine() (config.Config method), 10 checkFuse() (mount.MountControl method), 27 currentProfile() (configfile.ConfigFileWithProfiles checkHomeEncrypt() (in module tools), 55 method), 18 checkKnownHosts() (sshtools.SSH method), 49 CUSTOM_HOUR (config.Config attribute),8 checkLocks() (mount.MountControl method), 27 customBackupTime() (config.Config method), 10 checkLogin() (sshtools.SSH method), 49 checkPingHost() (sshtools.SSH method), 49 D checkRemoteCommands() (sshtools.SSH method), 49 Daemon (class in tools), 51 checkRemoteFolder() (sshtools.SSH method), 49 daemonize() (tools.Daemon method), 51 checkUnique() (tools.UniquenessSet method), 54 DAY (config.Config attribute),8 checkVersion() (encfstools.EncFS_mount method), 23 DBUS_SHUTDOWN (tools.ShutDown attribute), 53 checkVersion() (password.Password_Cache method), 32 debug() (in module logger), 24 checkXServer() (in module tools), 55 decMonth() (snapshots.Snapshots method), 41 clean() (tools.SetupUdev method), 53 Decode (class in encfstools), 22 cleanupHandler() (password.Password_Cache method), decode() (in module backintime),5 32 decodeOctalEscape() (in module tools), 55 cleanupHandler() (tools.Daemon method), 51 DEFAULT_EXCLUDE (config.Config attribute),8 clearHandlers() (configfile.ConfigFile method), 15 DEFAULT_REDIRECT_STDERR_IN_CRON (con- clearIdCache() (snapshots.Snapshots method), 41 fig.Config attribute),8 clearNameCache() (snapshots.Snapshots method), 41 DEFAULT_REDIRECT_STDOUT_IN_CRON (con- clearTakeSnapshotMessage() (snapshots.Snapshots fig.Config attribute),8 method), 41 DEFAULT_RUN_IONICE_FROM_CRON (con- cli (module),7 fig.Config attribute),8 close() (encfstools.Bounce method), 22 DEFAULT_RUN_IONICE_FROM_USER (con- close() (encfstools.Decode method), 22 fig.Config attribute),8 close() (encfstools.Encode method), 23 DEFAULT_RUN_IONICE_ON_REMOTE (con- closelog() (in module logger), 24 fig.Config attribute),8 collectPasswords() (password.Password_Cache method), DEFAULT_RUN_NICE_FROM_CRON (config.Config 32 attribute),8 collectPermission() (snapshots.Snapshots method), 41 DEFAULT_RUN_NICE_ON_REMOTE (config.Config compareRemount() (mount.MountControl method), 28 attribute),8 compareUmountInfo() (mount.MountControl method), DEFAULT_RUN_NOCACHE_ON_LOCAL (con- 28 fig.Config attribute),8 Config (class in config),8 DEFAULT_RUN_NOCACHE_ON_REMOTE (con- config (module),8 fig.Config attribute),8

70 Index Back In Time Development Documentation, Release 1.1.12

DEFAULT_SSH_PREFIX (config.Config attribute),8 F deletePath() (snapshots.Snapshots method), 41 FAILED (snapshots.SID attribute), 37 delfifo() (password_ipc.FIFO method), 33 failed (snapshots.SID attribute), 38 deprecated() (in module logger), 24 fdDup() (in module tools), 56 device() (in module tools), 55 FIFO (class in password_ipc), 33 discard() (tools.OrderedSet method), 53 fileId() (config.Config method), 10 DISK_UNIT_GB (config.Config attribute),8 FILEINFO (snapshots.SID attribute), 37 DISK_UNIT_MB (config.Config attribute),8 fileInfo (snapshots.SID attribute), 38 displayID (snapshots.GenericNonSnapshot attribute), 36 FileInfoDict (class in snapshots), 36 displayID (snapshots.SID attribute), 38 fileReadable() (progress.ProgressFile method), 34 displayName (snapshots.GenericNonSnapshot attribute), filesystem() (in module tools), 56 36 filesystemMountInfo() (in module tools), 56 displayName (snapshots.SID attribute), 38 filter() (snapshotlog.LogFilter method), 35 docPath() (config.Config method), 10 filter() (snapshots.Snapshots method), 42 dontRemoveNamedSnapshots() (config.Config method), filterRsyncProgress() (snapshots.Snapshots method), 42 10 flockExclusiv() (applicationinstance.ApplicationInstance DriveInfo (class in driveinfo), 21 method),3 driveinfo (module), 21 flockExclusive() (snapshots.Snapshots method), 42 Dummy (class in dummytools), 21 flockRelease() (snapshots.Snapshots method), 42 dummytools (module), 21 flockUnlock() (applicationinstance.ApplicationInstance method),3 E flush() (snapshotlog.SnapshotLog method), 35 EncFS_mount (class in encfstools), 23 frame() (in module cli),8 EncFS_SSH (class in encfstools), 22 freeSpace() (snapshots.Snapshots method), 42 encfsconfigBackupFolder() (config.Config method), 10 encfstools (module), 22 G Encode (class in encfstools), 23 GenericNonSnapshot (class in snapshots), 36 ENCODE (config.Config attribute),8 get() (snapshotlog.SnapshotLog method), 35 EncodeValueError, 23 getConfig() (in module backintime),5 env() (encfstools.EncFS_mount method), 23 gid() (snapshots.Snapshots method), 42 envLoad() (in module tools), 55 gitRevisionAndHash() (in module tools), 56 envSave() (in module tools), 56 GLOBAL_FLOCK (snapshots.Snapshots attribute), 40 ERROR (snapshotlog.LogFilter attribute), 35 globalFlock() (config.Config method), 10 error() (in module logger), 24 groupName() (snapshots.Snapshots method), 43 error() (pluginmanager.Plugin method), 33 GUIApplicationInstance (class in guiapplicationin- error() (pluginmanager.PluginManager method), 34 stance), 24 ERROR_AND_CHANGES (snapshotlog.LogFilter at- guiapplicationinstance (module), 24 tribute), 35 ERRORS (snapshotlog.SnapshotLog attribute), 35 H escapeIPv6Address() (in module tools), 56 handler() (tools.Alarm method), 51 exceptions (module), 23 hasChanges (snapshots.NewSnapshot attribute), 36 exclude() (config.Config method), 10 hash() (mount.MountControl method), 28 exclude() (encfstools.Bounce method), 22 HashCollision, 24 exclude() (encfstools.Encode method), 23 hashCollision() (config.Config method), 10 excludeBySize() (config.Config method), 10 hashIdPath() (mount.MountControl method), 29 excludeBySizeEnabled() (config.Config method), 10 hasKey() (configfile.ConfigFile method), 15 excludeV4() (config.Config method), 10 hasProfileKey() (configfile.ConfigFileWithProfiles Execute (class in tools), 52 method), 18 exists() (snapshots.SID method), 38 host() (config.Config method), 10 exitApplication() (applicationin- hostUserProfile() (config.Config method), 10 stance.ApplicationInstance method),3 hostUserProfileDefault() (config.Config method), 10 exp (config.Config attribute), 10 HOUR (config.Config attribute),8

Index 71 Back In Time Development Documentation, Release 1.1.12

I lockPath() (mount.MountControl method), 29 include() (config.Config method), 10 LOG (snapshots.SID attribute), 37 include() (encfstools.Bounce method), 22 log() (encfstools.Decode method), 22 include() (encfstools.Encode method), 23 log() (snapshots.SID method), 39 includeV4() (config.Config method), 10 logError() (pluginmanager.PluginManager method), 34 incMonth() (snapshots.Snapshots method), 43 LogFilter (class in snapshotlog), 34 incrementHashCollision() (config.Config method), 10 logger (module), 24 INFO (snapshots.SID attribute), 37 logLevel() (config.Config method), 10 info (snapshots.SID attribute), 38 info() (in module logger), 25 M INFORMATION (snapshotlog.LogFilter attribute), 35 makeDirs() (in module tools), 57 inhibitSuspend() (in module tools), 56 makeDirs() (snapshots.SID method), 39 init() (pluginmanager.Plugin method), 33 makeDirs() (snapshots.Snapshots method), 43 INTERFACE (tools.SetupUdev attribute), 53 makeWritable() (snapshots.SID method), 39 intValue() (configfile.ConfigFile method), 16 maxArgLength() (in module sshMaxArg), 47 InvalidChar, 24 md5sum() (in module tools), 57 InvalidCmd, 24 MEMBERS (tools.SetupUdev attribute), 53 ioniceOnCron() (config.Config method), 10 message() (pluginmanager.Plugin method), 33 ioniceOnRemote() (config.Config method), 10 message() (pluginmanager.PluginManager method), 34 ioniceOnUser() (config.Config method), 10 MIN_FREE_SPACE_UNITS (config.Config attribute),8 isConfigured() (config.Config method), 10 minFreeInodes() (config.Config method), 10 isConfigured() (encfstools.EncFS_mount method), 23 minFreeInodesEnabled() (config.Config method), 10 isFifo() (password_ipc.FIFO method), 33 minFreeSpace() (config.Config method), 10 isGui() (pluginmanager.Plugin method), 33 minFreeSpaceEnabled() (config.Config method), 11 isIPv6Address() (in module tools), 56 minFreeSpaceMib() (config.Config method), 11 isRoot() (in module tools), 56 mkdir() (in module tools), 57 iterSnapshots() (in module snapshots), 47 modeNeedPassword() (config.Config method), 11 MONTH (config.Config attribute),8 K Mount (class in mount), 25 keepOnlyOneSnapshot() (config.Config method), 10 mount (module), 25 keyringServiceName() (config.Config method), 10 mount() (encfstools.EncFS_SSH method), 22 keyringSupported() (in module tools), 57 mount() (mount.Mount method), 25 keyringUserName() (config.Config method), 10 mount() (mount.MountControl method), 29 keys() (configfile.ConfigFile method), 16 mount() (pluginmanager.Plugin method), 33 kill() (tools.Execute method), 52 mount() (pluginmanager.PluginManager method), 34 KnownHost, 24 mountArgs() (in module tools), 57 MountControl (class in mount), 26 L mounted() (mount.MountControl method), 29 lastChecked (snapshots.SID attribute), 38 MountException, 24 lastSnapshot() (in module backintime),5 mountLockAquire() (mount.MountControl method), 29 lastSnapshot() (in module snapshots), 47 mountLockCheck() (mount.MountControl method), 29 lastSnapshotPath() (in module backintime),5 mountLockRelease() (mount.MountControl method), 29 LastSnapshotSymlink, 24 mountpoint() (in module tools), 57 lastSnapshotSymlink() (config.Config method), 10 mountpoint() (mount.MountControl method), 30 license() (config.Config method), 10 mountProcessLockAcquire() (mount.MountControl LimitExceeded, 24 method), 29 list() (encfstools.Decode method), 22 mountProcessLockRelease() (mount.MountControl listSnapshots() (in module snapshots), 47 method), 29 listValue() (configfile.ConfigFile method), 16 load() (configfile.ConfigFile method), 16 N load() (configfile.ConfigFileWithProfiles method), 19 name (snapshots.NewSnapshot attribute), 36 load() (pluginmanager.PluginManager method), 34 name (snapshots.RootSnapshot attribute), 37 load() (progress.ProgressFile method), 34 NAME (snapshots.SID attribute), 38 localEncfsPath() (config.Config method), 10 name (snapshots.SID attribute), 39

72 Index Back In Time Development Documentation, Release 1.1.12 new() (snapshotlog.SnapshotLog method), 36 patternHasNotEncryptableWildcard() (in module tools), NewSnapshot (class in snapshots), 36 58 NEWSNAPSHOT (snapshots.NewSnapshot attribute), 36 pause() (tools.Execute method), 52 newSnapshot() (pluginmanager.Plugin method), 33 PermissionDeniedByPolicy, 24 newSnapshot() (pluginmanager.PluginManager method), pid() (config.Config method), 11 34 pid() (snapshots.Snapshots method), 43 next() (tools.PathHistory method), 53 pids() (in module tools), 58 niceOnCron() (config.Config method), 11 pidsWithName() (in module tools), 58 niceOnRemote() (config.Config method), 11 Plugin (class in pluginmanager), 33 NO_FILTER (snapshotlog.LogFilter attribute), 35 PLUGIN_MANAGER (config.Config attribute),9 nocacheOnLocal() (config.Config method), 11 PluginManager (class in pluginmanager), 34 nocacheOnRemote() (config.Config method), 11 pluginmanager (module), 33 NONE (config.Config attribute),9 pop() (tools.OrderedSet method), 53 NONE (snapshotlog.SnapshotLog attribute), 35 postMountCheck() (dummytools.Dummy method), 21 NoPubKeyLogin, 24 postMountCheck() (mount.MountControl method), 30 noSnapshotOnBattery() (config.Config method), 11 postUmountCheck() (dummytools.Dummy method), 21 notify() (config.Config method), 11 postUmountCheck() (mount.MountControl method), 30 notifyError() (configfile.ConfigFile method), 16 powerStatusAvailable() (in module tools), 58 preMountCheck() (dummytools.Dummy method), 21 O preMountCheck() (encfstools.EncFS_mount method), 23 OBJECT (tools.SetupUdev attribute), 53 preMountCheck() (encfstools.EncFS_SSH method), 22 olderThan() (config.Config method), 11 preMountCheck() (mount.Mount method), 25 onBattery() (in module tools), 57 preMountCheck() (mount.MountControl method), 30 openlog() (in module logger), 25 preMountCheck() (sshtools.SSH method), 49 OrderedSet (class in tools), 52 preparePath() (config.Config method), 11 preparePath() (in module tools), 58 P preserveAcl() (config.Config method), 11 Password (class in password), 32 preserveXattr() (config.Config method), 11 password (module), 32 preUmountCheck() (dummytools.Dummy method), 21 password() (config.Config method), 11 preUmountCheck() (mount.MountControl method), 30 password() (in module tools), 58 previous() (tools.PathHistory method), 53 password() (password.Password method), 32 printHeader() (in module backintime),5 Password_Cache (class in password), 32 printLicense (class in backintime),5 password_ipc (module), 33 processAlive() (in module tools), 58 passwordCacheFifo() (config.Config method), 11 processBegin() (pluginmanager.Plugin method), 33 passwordCacheFolder() (config.Config method), 11 processBegin() (pluginmanager.PluginManager method), passwordCacheInfo() (config.Config method), 11 34 passwordCachePid() (config.Config method), 11 processCmdline() (in module tools), 58 passwordFromCache() (password.Password method), 32 processEnd() (pluginmanager.Plugin method), 34 passwordFromKeyring() (password.Password method), processEnd() (pluginmanager.PluginManager method), 32 34 passwordFromUser() (password.Password method), 32 processExists() (in module tools), 59 passwordSave() (config.Config method), 11 processName() (in module tools), 59 passwordUseCache() (config.Config method), 11 processPaused() (in module tools), 59 path() (encfstools.Bounce method), 22 processStat() (in module tools), 59 path() (encfstools.Decode method), 22 profileBoolValue() (configfile.ConfigFileWithProfiles path() (encfstools.Encode method), 23 method), 19 path() (snapshots.RootSnapshot method), 37 profileExists() (configfile.ConfigFileWithProfiles path() (snapshots.SID method), 39 method), 19 pathBackup() (snapshots.SID method), 39 profileExistsByName() (config- PathHistory (class in tools), 53 file.ConfigFileWithProfiles method), 19 pathMatch() (encfstools.Decode method), 22 profileIntValue() (configfile.ConfigFileWithProfiles pathWithArrow() (encfstools.Decode method), 22 method), 19

Index 73 Back In Time Development Documentation, Release 1.1.12 profileKey() (configfile.ConfigFileWithProfiles method), removeKeysStartsWith() (configfile.ConfigFile method), 19 17 profileListValue() (configfile.ConfigFileWithProfiles removeOldCrontab() (config.Config method), 11 method), 19 removeOldSnapshots() (config.Config method), 11 profileName() (configfile.ConfigFileWithProfiles removeOldSnapshotsDate() (config.Config method), 11 method), 19 removeOldSnapshotsEnabled() (config.Config method), profiles() (configfile.ConfigFileWithProfiles method), 19 11 profilesSortedByName() (config- removeProfile() (configfile.ConfigFileWithProfiles file.ConfigFileWithProfiles method), 19 method), 20 profileStrValue() (configfile.ConfigFileWithProfiles removeProfileKey() (configfile.ConfigFileWithProfiles method), 19 method), 20 progress (module), 34 removeProfileKeysStartsWith() (config- ProgressFile (class in progress), 34 file.ConfigFileWithProfiles method), 20 PseudoAliasAction (class in backintime),4 removeSymlink() (mount.MountControl method), 31 PW_CACHE_VERSION (password.Password_Cache at- REPEATEDLY (config.Config attribute),9 tribute), 32 REPEATEDLY_UNITS (config.Config attribute),9 pwCache() (in module backintime),6 replace() (encfstools.Decode method), 22 reportResult() (in module sshMaxArg), 47 R reportTest() (in module sshMaxArg), 47 raiseCommand() (guiapplicationin- reset() (tools.PathHistory method), 53 stance.GUIApplicationInstance method), restart() (tools.Daemon method), 51 24 restore() (in module backintime),6 randomId() (in module sshMaxArg), 47 restore() (in module cli),8 randomId() (sshtools.SSH method), 50 restore() (snapshots.Snapshots method), 43 read() (password_ipc.FIFO method), 33 restoreCallback() (snapshots.Snapshots method), 43 read() (password_ipc.TempPasswordThread method), 33 RestoreDialog (class in cli),7 readCrontab() (in module tools), 59 restoreInstanceFile() (config.Config method), 11 readFile() (in module tools), 59 restoreLogFile() (config.Config method), 11 readFileLines() (in module tools), 59 restorePermission() (snapshots.Snapshots method), 44 readPidFile() (applicationinstance.ApplicationInstance resume() (tools.Execute method), 52 method),4 RootSnapshot (class in snapshots), 37 readTimeStamp() (in module tools), 60 RSYNC (progress.ProgressFile attribute), 34 readUmountInfo() (mount.MountControl method), 31 rsyncCallback() (snapshots.Snapshots method), 44 redirectStderrInCron() (config.Config method), 11 rsyncCaps() (in module tools), 60 redirectStdoutInCron() (config.Config method), 11 rsyncExclude() (snapshots.Snapshots method), 44 REGEX (snapshotlog.LogFilter attribute), 35 rsyncInclude() (snapshots.Snapshots method), 44 registerBackintimePath() (in module tools), 60 rsyncOptions() (config.Config method), 11 reload() (tools.Daemon method), 51 rsyncOptionsEnabled() (config.Config method), 11 reloadHandler() (password.Password_Cache method), 32 rsyncPrefix() (in module tools), 60 remapKey() (configfile.ConfigFile method), 16 rsyncRemotePath() (snapshots.Snapshots method), 44 remapKeyRegex() (configfile.ConfigFile method), 17 rsyncRemove() (in module tools), 60 remapProfileKey() (configfile.ConfigFileWithProfiles rsyncSshArgs() (in module tools), 61 method), 20 rsyncSuffix() (snapshots.Snapshots method), 45 remote() (encfstools.Bounce method), 22 run() (cli.BackupJobDaemon method),7 remote() (encfstools.Decode method), 22 run() (cli.RestoreDialog method),8 remote() (encfstools.Encode method), 23 run() (password.Password_Cache method), 32 remount() (mount.Mount method), 26 run() (password_ipc.TempPasswordThread method), 33 remove() (in module backintime),6 run() (tools.Daemon method), 52 remove() (in module cli),8 run() (tools.Execute method), 52 remove() (snapshots.Snapshots method), 43 runningFromSource() (in module tools), 61 REMOVE_OLD_BACKUP_UNITS (config.Config at- tribute),9 S removeAndDoNotAskAgain() (in module backintime),6 save() (config.Config method), 11 removeKey() (configfile.ConfigFile method), 17 save() (configfile.ConfigFile method), 17

74 Index Back In Time Development Documentation, Release 1.1.12 save() (progress.ProgressFile method), 34 setPassword() (in module tools), 61 save() (tools.SetupUdev method), 53 setPassword() (password.Password method), 32 SAVETOCONTINUE (snapshots.NewSnapshot at- setPasswordCache() (password.Password method), 32 tribute), 36 setPasswordDb() (password.Password method), 32 saveToContinue (snapshots.NewSnapshot attribute), 37 setPasswordKeyring() (password.Password method), 32 SCHEDULE_MODES (config.Config attribute),9 setPasswordSave() (config.Config method), 12 scheduleDay() (config.Config method), 12 setPasswordUseCache() (config.Config method), 12 scheduleMode() (config.Config method), 12 setPreserveAcl() (config.Config method), 13 scheduleRepeatedPeriod() (config.Config method), 12 setPreserveXattr() (config.Config method), 13 scheduleRepeatedUnit() (config.Config method), 12 setProfileBoolValue() (configfile.ConfigFileWithProfiles scheduleTime() (config.Config method), 12 method), 20 scheduleWeekday() (config.Config method), 12 setProfileIntValue() (configfile.ConfigFileWithProfiles selectSnapshot() (in module cli),8 method), 20 setattrKwargs() (mount.MountControl method), 31 setProfileListValue() (configfile.ConfigFileWithProfiles setBackupOnRestore() (config.Config method), 12 method), 20 setBoolValue() (configfile.ConfigFile method), 17 setProfileName() (configfile.ConfigFileWithProfiles setBwlimit() (config.Config method), 12 method), 20 setContinueOnErrors() (config.Config method), 12 setProfileStrValue() (configfile.ConfigFileWithProfiles setCopyLinks() (config.Config method), 12 method), 21 setCopyUnsafeLinks() (config.Config method), 12 setQuestionHandler() (configfile.ConfigFile method), 18 setCurrentHashId() (config.Config method), 12 setQuiet() (in module backintime),6 setCurrentProfile() (configfile.ConfigFileWithProfiles setRedirectStderrInCron() (config.Config method), 13 method), 20 setRedirectStdoutInCron() (config.Config method), 13 setCurrentProfileByName() (config- setRemoveOldSnapshots() (config.Config method), 13 file.ConfigFileWithProfiles method), 20 setRsyncOptions() (config.Config method), 13 setCustomBackupTime() (config.Config method), 12 setScheduleDay() (config.Config method), 13 setDefaultArgs() (mount.MountControl method), 31 setScheduleMode() (config.Config method), 13 setDontRemoveNamedSnapshots() (config.Config setScheduleRepeatedPeriod() (config.Config method), 13 method), 12 setScheduleRepeatedUnit() (config.Config method), 13 setErrorHandler() (configfile.ConfigFile method), 17 setScheduleTime() (config.Config method), 13 setExclude() (config.Config method), 12 setScheduleWeekday() (config.Config method), 13 setExcludeBySize() (config.Config method), 12 setSmartRemove() (config.Config method), 13 setGlobalFlock() (config.Config method), 12 setSmartRemoveRunRemoteInBackground() (con- setHostUserProfile() (config.Config method), 12 fig.Config method), 13 setInclude() (config.Config method), 12 setSnapshotsMode() (config.Config method), 13 setIntValue() (configfile.ConfigFile method), 17 setSnapshotsPath() (config.Config method), 13 setIoniceOnCron() (config.Config method), 12 setSshCheckCommands() (config.Config method), 13 setIoniceOnRemote() (config.Config method), 12 setSshCheckPingHost() (config.Config method), 13 setIoniceOnUser() (config.Config method), 12 setSshCipher() (config.Config method), 13 setKeepOnlyOneSnapshot() (config.Config method), 12 setSshHost() (config.Config method), 13 setLastChecked() (snapshots.SID method), 39 setSshMaxArgLength() (config.Config method), 13 setListValue() (configfile.ConfigFile method), 17 setSshPort() (config.Config method), 13 setLocalEncfsPath() (config.Config method), 12 setSshPrefix() (config.Config method), 13 setLog() (snapshots.SID method), 40 setSshPrivateKeyFile() (config.Config method), 13 setLogLevel() (config.Config method), 12 setSshSnapshotsPath() (config.Config method), 13 setMinFreeInodes() (config.Config method), 12 setSshUser() (config.Config method), 13 setMinFreeSpace() (config.Config method), 12 setStrValue() (configfile.ConfigFile method), 18 setNiceOnCron() (config.Config method), 12 setSymlink() (mount.MountControl method), 31 setNiceOnRemote() (config.Config method), 12 setTakeSnapshotMessage() (snapshots.Snapshots setNocacheOnLocal() (config.Config method), 12 method), 45 setNocacheOnRemote() (config.Config method), 12 setTakeSnapshotRegardlessOfChanges() (config.Config setNoSnapshotOnBattery() (config.Config method), 12 method), 13 setNotify() (config.Config method), 12 setupCron() (config.Config method), 13 setPassword() (config.Config method), 12 SetupUdev (class in tools), 53

Index 75 Back In Time Development Documentation, Release 1.1.12 setUseChecksum() (config.Config method), 13 sshSnapshotsFullPath() (config.Config method), 14 sharePath() (in module tools), 61 sshSnapshotsPath() (config.Config method), 14 ShutDown (class in tools), 53 sshtools (module), 48 shutdown() (in module backintime),6 sshUser() (config.Config method), 14 shutdown() (tools.ShutDown method), 53 start() (tools.Alarm method), 51 SID (class in snapshots), 37 start() (tools.Daemon method), 52 smartRemove() (config.Config method), 13 startApp() (in module backintime),7 smartRemove() (in module backintime),6 startApplication() (applicationin- smartRemove() (snapshots.Snapshots method), 45 stance.ApplicationInstance method),4 smartRemoveKeepAll() (snapshots.Snapshots method), starter() (password_ipc.TempPasswordThread method), 45 33 smartRemoveKeepFirst() (snapshots.Snapshots method), startProcess() (encfstools.Decode method), 22 45 startProcess() (encfstools.Encode method), 23 smartRemoveList() (snapshots.Snapshots method), 45 startSshAgent() (sshtools.SSH method), 50 smartRemoveRunRemoteInBackground() (config.Config statFreeSpaceLocal() (snapshots.Snapshots method), 46 method), 13 statFreeSpaceSsh() (snapshots.Snapshots method), 46 SNAPSHOT_MODES (config.Config attribute),9 status() (tools.Daemon method), 52 SNAPSHOT_VERSION (snapshots.Snapshots attribute), stop() (password_ipc.TempPasswordThread method), 33 40 stop() (tools.Alarm method), 51 SnapshotLog (class in snapshotlog), 35 stop() (tools.Daemon method), 52 snapshotlog (module), 34 StopException, 24 Snapshots (class in snapshots), 40 strValue() (configfile.ConfigFile method), 18 snapshots (module), 36 support_hardlinks() (driveinfo.DriveInfo method), 21 snapshotsFullPath() (config.Config method), 13 support_permissions() (driveinfo.DriveInfo method), 21 snapshotsList() (in module backintime),6 support_usergroup() (driveinfo.DriveInfo method), 21 snapshotsListPath() (in module backintime),6 syncfs() (in module tools), 61 snapshotsMode() (config.Config method), 13 SYSTEM_ENTRY_MESSAGE (config.Config attribute), snapshotsPath() (config.Config method), 13 9 snapshotsPath() (in module backintime),7 snapshotsSymlink() (config.Config method), 14 T split() (snapshots.SID method), 40 tag (snapshots.GenericNonSnapshot attribute), 36 splitCommands() (in module tools), 61 tag (snapshots.SID attribute), 40 splitKwargs() (encfstools.EncFS_SSH method), 22 tag() (config.Config method), 15 SSH (class in sshtools), 48 takeSnapshot() (in module backintime),7 SSH_CIPHERS (config.Config attribute),9 takeSnapshot() (snapshots.Snapshots method), 46 sshCheckCommands() (config.Config method), 14 takeSnapshotAsync() (in module backintime),7 sshCheckPingHost() (config.Config method), 14 takeSnapshotInstanceFile() (config.Config method), 15 sshCipher() (config.Config method), 14 takeSnapshotLogFile() (config.Config method), 15 sshCommand() (config.Config method), 14 takeSnapshotMessage() (snapshots.Snapshots method), sshCopyId() (in module sshtools), 50 46 sshDefaultArgs() (config.Config method), 14 takeSnapshotMessageFile() (config.Config method), 15 sshHost() (config.Config method), 14 takeSnapshotProgressFile() (config.Config method), 15 sshHostKey() (in module sshtools), 50 takeSnapshotRegardlessOfChanges() (config.Config sshHostUserPortPathCipher() (config.Config method), 14 method), 15 sshKeyFingerprint() (in module sshtools), 51 takeSnapshotUserCallback() (config.Config method), 15 sshKeyGen() (in module sshtools), 51 tempFailureRetry() (in module tools), 61 sshMaxArg (module), 47 TempPasswordThread (class in password_ipc), 33 sshMaxArgLength() (config.Config method), 14 terminalSize() (in module cli),8 sshPort() (config.Config method), 14 Timeout, 24 sshPrefix() (config.Config method), 14 tools (module), 51 sshPrefixCmd() (config.Config method), 14 translations() (config.Config method), 15 sshPrefixEnabled() (config.Config method), 14 sshPrivateKeyFile() (config.Config method), 14 U sshPrivateKeyFolder() (config.Config method), 14 UDEV (config.Config attribute),9

76 Index Back In Time Development Documentation, Release 1.1.12 udevRulesPath() (config.Config method), 15 uid() (snapshots.Snapshots method), 46 umount() (encfstools.EncFS_SSH method), 23 umount() (mount.Mount method), 26 umount() (mount.MountControl method), 31 umountInfoPath() (mount.MountControl method), 31 unInhibitSuspend() (in module tools), 61 UniquenessSet (class in tools), 54 unity7() (tools.ShutDown method), 53 unlockSshAgent() (sshtools.SSH method), 50 unmount() (in module backintime),7 unmount() (pluginmanager.Plugin method), 34 unmount() (pluginmanager.PluginManager method), 34 useChecksum() (config.Config method), 15 user() (config.Config method), 15 userCallbackNoLogging() (config.Config method), 15 userName() (snapshots.Snapshots method), 47 usingSudo() (in module tools), 62 uuidFromDev() (in module tools), 62 uuidFromPath() (in module tools), 62 V VERSION (config.Config attribute),9 W warning() (in module logger), 25 WEEK (config.Config attribute),9 which() (in module tools), 62 withoutTag (snapshots.GenericNonSnapshot attribute), 36 withoutTag (snapshots.SID attribute), 40 wrapLine() (in module tools), 62 write() (password_ipc.FIFO method), 33 writeCrontab() (in module tools), 62 writeKnownHostsFile() (in module sshtools), 51 writeTimeStamp() (in module tools), 63 writeUmountInfo() (mount.MountControl method), 32 Y YEAR (config.Config attribute),9

Index 77