config module
Configuration logic.
This module and its Config class contain the application logic handling the
configuration of Back In Time. The handling of the configuration file itself
is separated in the module configfile
.
- Development notes:
Some of the methods have code comments starting with #? ` instead of `# `. These special comments are used to generate the manpage `backintime-config. The script create-manpage-backintime-config.py parses this module for that.
- class config.Config(config_path=None, data_path=None)[source]
Bases:
ConfigFileWithProfiles
- APP_NAME = 'Back In Time'
- AT_EVERY_BOOT = 1
- CONFIG_VERSION = 6
Latest or highest possible version of Back in Time’s config file.
- COPYRIGHT = 'Copyright (C) 2008-2024 Oprea Dan, Bart de Koning, Richard Bailey, Germar Reitze, Christian Buhtz, Michael Büker, Jürgen Altfeld et al.'
- 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', '/swapfile', 'SingletonLock', 'SingletonCookie', 'lock']
- 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
- MONTH = 40
- NONE = 0
- PLUGIN_MANAGER = <pluginmanager.PluginManager object>
- REPEATEDLY = 25
- SYSTEM_ENTRY_MESSAGE = '#Back In Time system entry, this will be edited by the gui:'
The string is used in crontab file to mark entries as owned by Back In Time. WARNING: Don’t modify that string in code because it is used as match target while parsing the crontab file.
- UDEV = 27
- WEEK = 30
- YEAR = 80
- decrement_manual_starts_countdown()[source]
Counts down to -1.
See
manual_starts_countdown()
for details.
- language_used
ISO-639 language code of the used language. See tools._determine_current_used_language_code() for details.
- manual_starts_countdown() int [source]
Countdown value about how often the users started the Back In Time GUI.
It is an internal variable not meant to be used or manipulated be the users. At the end of the countown the
ApproachTranslatorDialog
is presented to the user.
- olderThan(time, value, unit)[source]
return True if time is older than months, weeks, days or hours
- setSmartRemove(value, keep_all, keep_one_per_day, keep_one_per_week, keep_one_per_month, profile_id=None)[source]
- setSnapshotsPath(value, profile_id=None, mode=None)[source]
Sets the snapshot path to value, initializes, and checks it
- snapshotsFullPath(profile_id=None)[source]
Returns the full path for the snapshots: …/backintime/machine/user/profile_id/
- 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
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:
- sshDefaultArgs(profile_id=None)[source]
Default arguments used for
ssh
andsshfs
commands.- Returns:
arguments for ssh
- Return type:
- sshSnapshotsFullPath(profile_id=None)[source]
Returns the full path for the snapshots: …/backintime/machine/user/profile_id/
- 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