backintime module
- class backintime.PseudoAliasAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]
Bases:
Action
Translate ‘–COMMAND’ into ‘COMMAND’ for backwards compatibility.
- backintime._mount(cfg)[source]
Mount external filesystems.
- Parameters:
cfg (config.Config) – config that should be used
- backintime._umount(cfg)[source]
Unmount external filesystems.
- Parameters:
cfg (config.Config) – config that should be used
- backintime.aliasParser(args)[source]
Call commands which where given with leading – for backwards compatibility.
- Parameters:
args (argparse.Namespace) – previously parsed arguments
- backintime.argParse(args)[source]
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)[source]
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
- backintime.backupJob(args)[source]
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)[source]
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)[source]
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')[source]
Define parsers for commandline arguments.
- Parameters:
app_name (str) – string representing the current application
- backintime.decode(args)[source]
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)[source]
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:
- Raises:
SystemExit – 1 if
profile
orprofile_id
is no valid profile 2 ifcheck
isTrue
and config is not configured
- backintime.lastSnapshot(args)[source]
Command for printing the very last snapshot in current profile.
- Parameters:
args (argparse.Namespace) – previously parsed arguments
- Raises:
SystemExit – 0
- backintime.lastSnapshotPath(args)[source]
Command for printing the path of the very last snapshot in current profile.
- Parameters:
args (argparse.Namespace) – previously parsed arguments
- Raises:
SystemExit – 0
- class backintime.printDiagnostics(*args, **kwargs)[source]
Bases:
Action
Print information that is helpful for the support team to narrow down problems and bugs. The info is printed using the machine- and human-readable JSON format
- backintime.pwCache(args)[source]
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)[source]
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)[source]
Command for removing snapshots without asking before remove (BE CAREFUL!)
- Parameters:
args (argparse.Namespace) – previously parsed arguments
- Raises:
SystemExit – 0
- backintime.restore(args)[source]
Command for restoring files from snapshots.
- Parameters:
args (argparse.Namespace) – previously parsed arguments
- Raises:
SystemExit – 0
- backintime.setQuiet(args)[source]
Redirect
sys.stdout
to/dev/null
if--quiet
was set on commandline. Return the originalsys.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)[source]
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)[source]
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)[source]
Command for printing a list of all snapshots in current profile.
- Parameters:
args (argparse.Namespace) – previously parsed arguments
- Raises:
SystemExit – 0
- backintime.snapshotsListPath(args)[source]
Command for printing a list of all snapshots paths in current profile.
- Parameters:
args (argparse.Namespace) – previously parsed arguments
- Raises:
SystemExit – 0
- backintime.snapshotsPath(args)[source]
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')[source]
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:
- backintime.takeSnapshot(cfg, force=True)[source]
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 there was an error- Return type:
- backintime.takeSnapshotAsync(cfg, checksum=False)[source]
Fork 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)[source]
Command for unmounting all filesystems.
- Parameters:
args (argparse.Namespace) – previously parsed arguments
- Raises:
SystemExit – 0