config module

class config.Config(config_path=None, data_path=None)[source]

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 = ['.gvfs', '.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 = <encfstools.Bounce object>
HOUR = 10
MIN_FREE_SPACE_UNITS = {10: 'MiB', 20: 'GiB'}
MONTH = 40
NONE = 0
PLUGIN_MANAGER = <pluginmanager.PluginManager object>
REMOVE_OLD_BACKUP_UNITS = {80: 'Year(s)', 20: 'Day(s)', 30: 'Week(s)'}
REPEATEDLY = 25
REPEATEDLY_UNITS = {40: 'Month(s)', 10: 'Hour(s)', 20: 'Day(s)', 30: 'Week(s)'}
SCHEDULE_MODES = {0: 'Disabled', 1: 'At every boot/reboot', 2: 'Every 5 minutes', 4: 'Every 10 minutes', 7: 'Every 30 minutes', 40: 'Every Month', 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'}
SNAPSHOT_MODES = {'ssh_encfs': (<class 'encfstools.EncFS_SSH'>, 'SSH encrypted', 'SSH private key', 'Encryption'), 'local': (None, 'Local', False, False), 'ssh': (<class 'sshtools.SSH'>, 'SSH', 'SSH private key', False), 'local_encfs': (<class 'encfstools.EncFS_mount'>, 'Local encrypted', 'Encryption', False)}
SSH_CIPHERS = {'aes256-ctr': 'AES256-CTR', 'blowfish-cbc': 'Blowfish-CBC', 'cast128-cbc': 'Cast128-CBC', 'aes192-ctr': 'AES192-CTR', 'arcfour256': 'ARCFOUR256', '3des-cbc': '3DES-CBC', 'arcfour': 'ARCFOUR', 'aes256-cbc': 'AES256-CBC', 'default': 'Default', 'aes128-ctr': 'AES128-CTR', 'arcfour128': 'ARCFOUR128', 'aes128-cbc': 'AES128-CBC', 'aes192-cbc': 'AES192-CBC'}
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)[source]
anacronSpool()[source]
anacronSpoolFile(profile_id=None)[source]
anacrontab(suffix='')[source]

Deprecated since 1.1. Just keep this to delete old anacrontab files

anacrontabFiles()[source]

list existing old anacrontab files

appInstanceFile()[source]
appPath()[source]
authors()[source]
backupOnRestore(profile_id=None)[source]
backupScheduled(profile_id=None)[source]

check if profile is supposed to be run this time

bwlimit(profile_id=None)[source]
bwlimitEnabled(profile_id=None)[source]
canBackup(profile_id=None)[source]

Checks if snapshots_path exists

changelog()[source]
checkConfig()[source]
continueOnErrors(profile_id=None)[source]
createNewCrontab(oldCrontab)[source]
cronCmd(profile_id)[source]
cronEnvFile()[source]
cronLine(profile_id)[source]
customBackupTime(profile_id=None)[source]
docPath()[source]
dontRemoveNamedSnapshots(profile_id=None)[source]
encfsconfigBackupFolder(profile_id=None)[source]
exclude(profile_id=None)[source]

Gets the exclude patterns

excludeBySize(profile_id=None)[source]
excludeBySizeEnabled(profile_id=None)[source]
excludeV4(profile_id=None)[source]

Gets the exclude patterns: conf version 4

exp = ' EXPERIMENTAL!'
fileId(profile_id=None)[source]
globalFlock()[source]
hashCollision()[source]
host()[source]
hostUserProfile(profile_id=None)[source]
hostUserProfileDefault(profile_id=None)[source]
include(profile_id=None)[source]
includeV4(profile_id=None)[source]
incrementHashCollision()[source]
ioniceOnCron(profile_id=None)[source]
ioniceOnRemote(profile_id=None)[source]
ioniceOnUser(profile_id=None)[source]
isConfigured(profile_id=None)[source]

Checks if the program is configured

keepOnlyOneSnapshot(profile_id=None)[source]
keyringServiceName(profile_id=None, mode=None, pw_id=1)[source]
keyringUserName(profile_id=None)[source]
license()[source]
localEncfsPath(profile_id=None)[source]
logLevel(profile_id=None)[source]
minFreeInodes(profile_id=None)[source]
minFreeInodesEnabled(profile_id=None)[source]
minFreeSpace(profile_id=None)[source]
minFreeSpaceEnabled(profile_id=None)[source]
minFreeSpaceMib(profile_id=None)[source]
modeNeedPassword(mode, pw_id=1)[source]
niceOnCron(profile_id=None)[source]
niceOnRemote(profile_id=None)[source]
noSnapshotOnBattery(profile_id=None)[source]
nocacheOnLocal(profile_id=None)[source]
nocacheOnRemote(profile_id=None)[source]
notify(profile_id=None)[source]
olderThan(time, value, unit)[source]

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)[source]
passwordCacheFifo()[source]
passwordCacheFolder()[source]
passwordCacheInfo()[source]
passwordCachePid()[source]
passwordSave(profile_id=None, mode=None)[source]
passwordUseCache(profile_id=None, mode=None)[source]
pid()[source]
preparePath(path)[source]
preserveAcl(profile_id=None)[source]
preserveXattr(profile_id=None)[source]
redirectStderrInCron(profile_id=None)[source]
redirectStdoutInCron(profile_id=None)[source]
removeOldCrontab(crontab)[source]
removeOldSnapshots(profile_id=None)[source]
removeOldSnapshotsDate(profile_id=None)[source]
removeOldSnapshotsEnabled(profile_id=None)[source]
restoreInstanceFile(profile_id=None)[source]
restoreLogFile(profile_id=None)[source]
rsyncOptions(profile_id=None)[source]
rsyncOptionsEnabled(profile_id=None)[source]
save()[source]
scheduleDay(profile_id=None)[source]
scheduleMode(profile_id=None)[source]
scheduleRepeatedPeriod(profile_id=None)[source]
scheduleRepeatedUnit(profile_id=None)[source]
scheduleTime(profile_id=None)[source]
scheduleWeekday(profile_id=None)[source]
setBackupOnRestore(value, profile_id=None)[source]
setBwlimit(enabled, value, profile_id=None)[source]
setContinueOnErrors(value, profile_id=None)[source]
setCurrentHashId(hash_id)[source]
setCustomBackupTime(value, profile_id=None)[source]
setDontRemoveNamedSnapshots(value, profile_id=None)[source]
setExclude(values, profile_id=None)[source]
setExcludeBySize(enabled, value, profile_id=None)[source]
setGlobalFlock(value)[source]
setHostUserProfile(host, user, profile, profile_id=None)[source]
setInclude(values, profile_id=None)[source]
setIoniceOnCron(value, profile_id=None)[source]
setIoniceOnRemote(value, profile_id=None)[source]
setIoniceOnUser(value, profile_id=None)[source]
setKeepOnlyOneSnapshot(value, profile_id=None)[source]
setLocalEncfsPath(value, profile_id=None)[source]
setLogLevel(value, profile_id=None)[source]
setMinFreeInodes(enabled, value, profile_id=None)[source]
setMinFreeSpace(enabled, value, unit, profile_id=None)[source]
setNiceOnCron(value, profile_id=None)[source]
setNiceOnRemote(value, profile_id=None)[source]
setNoSnapshotOnBattery(value, profile_id=None)[source]
setNocacheOnLocal(value, profile_id=None)[source]
setNocacheOnRemote(value, profile_id=None)[source]
setNotify(value, profile_id=None)[source]
setPassword(password, profile_id=None, mode=None, pw_id=1)[source]
setPasswordSave(value, profile_id=None, mode=None)[source]
setPasswordUseCache(value, profile_id=None, mode=None)[source]
setPreserveAcl(value, profile_id=None)[source]
setPreserveXattr(value, profile_id=None)[source]
setRedirectStderrInCron(value, profile_id=None)[source]
setRedirectStdoutInCron(value, profile_id=None)[source]
setRemoveOldSnapshots(enabled, value, unit, profile_id=None)[source]
setRsyncOptions(enabled, value, profile_id=None)[source]
setScheduleDay(value, profile_id=None)[source]
setScheduleMode(value, profile_id=None)[source]
setScheduleRepeatedPeriod(value, profile_id=None)[source]
setScheduleRepeatedUnit(value, profile_id=None)[source]
setScheduleTime(value, profile_id=None)[source]
setScheduleWeekday(value, profile_id=None)[source]
setSmartRemove(value, keep_all, keep_one_per_day, keep_one_per_week, keep_one_per_month, profile_id=None)[source]
setSmartRemoveRunRemoteInBackground(value, profile_id=None)[source]
setSnapshotsMode(value, profile_id=None)[source]
setSnapshotsPath(value, profile_id=None, mode=None)[source]

Sets the snapshot path to value, initializes, and checks it

setSshCheckCommands(value, profile_id=None)[source]
setSshCheckPingHost(value, profile_id=None)[source]
setSshCipher(value, profile_id=None)[source]
setSshHost(value, profile_id=None)[source]
setSshMaxArgLength(value, profile_id=None)[source]
setSshPort(value, profile_id=None)[source]
setSshPrefix(enabled, value, profile_id=None)[source]
setSshPrivateKeyFile(value, profile_id=None)[source]
setSshSnapshotsPath(value, profile_id=None)[source]
setSshUser(value, profile_id=None)[source]
setTakeSnapshotRegardlessOfChanges(value, profile_id=None)[source]
setTakeSnapshotUserScript(step, path, profile_id=None)[source]
setTakeSnapshotUserScriptAfter(path, profile_id=None)[source]
setTakeSnapshotUserScriptBefore(path, profile_id=None)[source]
setTakeSnapshotUserScriptError(path, profile_id=None)[source]
setTakeSnapshotUserScriptNewSnapshot(path, profile_id=None)[source]
setUseChecksum(value, profile_id=None)[source]
setupCron()[source]
smartRemove(profile_id=None)[source]
smartRemoveRunRemoteInBackground(profile_id=None)[source]
snapshotsFullPath(profile_id=None)[source]

Returns the full path for the snapshots: .../backintime/machine/user/profile_id/

snapshotsMode(profile_id=None)[source]
snapshotsPath(profile_id=None, mode=None, tmp_mount=False)[source]
sshCheckCommands(profile_id=None)[source]
sshCheckPingHost(profile_id=None)[source]
sshCipher(profile_id=None)[source]
sshCommand(cmd=None, custom_args=None, port=True, cipher=True, user_host=True, ionice=True, nice=True, quote=False, prefix=True, profile_id=None)[source]

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)[source]

Default arguments used for ssh and sshfs commands.

Returns:arguments for ssh
Return type:list
sshHost(profile_id=None)[source]
sshHostUserPortPathCipher(profile_id=None)[source]
sshMaxArgLength(profile_id=None)[source]
sshPort(profile_id=None)[source]
sshPrefix(profile_id=None)[source]
sshPrefixCmd(profile_id=None, cmd_type=<class 'str'>)[source]
sshPrefixEnabled(profile_id=None)[source]
sshPrivateKeyFile(profile_id=None)[source]
sshPrivateKeyFolder()[source]
sshSnapshotsFullPath(profile_id=None)[source]

Returns the full path for the snapshots: .../backintime/machine/user/profile_id/

sshSnapshotsPath(profile_id=None)[source]
sshUser(profile_id=None)[source]
tag(profile_id=None)[source]
takeSnapshotInstanceFile(profile_id=None)[source]
takeSnapshotLogFile(profile_id=None)[source]
takeSnapshotMessageFile(profile_id=None)[source]
takeSnapshotProgressFile(profile_id=None)[source]
takeSnapshotRegardlessOfChanges(profile_id=None)[source]
takeSnapshotUserCallback()[source]
takeSnapshotUserScript(step, profile_id=None)[source]
takeSnapshotUserScriptAfter(profile_id=None)[source]
takeSnapshotUserScriptBefore(profile_id=None)[source]
takeSnapshotUserScriptError(profile_id=None)[source]
takeSnapshotUserScriptNewSnapshot(profile_id=None)[source]
translations()[source]
udevRulesPath()[source]
useChecksum(profile_id=None)[source]
user()[source]

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)[source]