Update docstrings for rbackup.script

This commit is contained in:
Eric Torres 2019-04-28 22:24:54 -07:00
parent 834d8b1733
commit 2e1bc6130e

View File

@ -25,15 +25,19 @@ syslog = logging.getLogger(__name__)
def do_backup(repository, parsed_config, args, extra_rsync_opts=None):
"""Run a backup operation.
It is up to the caller to decide on how to instantiate the Repository object.
A backup operation requires a repository, config options to read from, and the
arguments that were passed when the script was started.
It is up to the caller to decide on how to instantiate the ``Repository`` object.
:param repository: repository to operate on
:type repository: ``rbackup.struct.repository.Repository`` object
:param parsed_config:
:param parsed_config: config file parser
:type parsed_config: ``configparser.ConfigParser`` object
:param args: arguments relevant to the backup operation
:param args: arguments passed when the script was called
:type args: ``argparse.Namespace`` object
:param extra_rsync_opts: more options to pass to rsync
:param extra_rsync_opts: options to pass to rsync that weren't included
in args (default: ``None``)
:type extra_rsync_opts: iterable
"""
rsync_opts = config.load_list_from_option(
@ -74,4 +78,3 @@ def do_backup(repository, parsed_config, args, extra_rsync_opts=None):
syslog.critical(f"Failing command: {e.cmd}")
syslog.critical(e.stderr)
exit(e.returncode)