Fix order of log message handling
This commit is contained in:
parent
0f56420fd6
commit
9b9744ad1d
14
bin/backup
14
bin/backup
@ -132,12 +132,20 @@ def parse_cmdline_arguments(**kwargs):
|
||||
if __name__ == "__main__":
|
||||
args = parse_cmdline_arguments()
|
||||
|
||||
if args.verbose:
|
||||
stdout_handler.setLevel(logging.INFO)
|
||||
|
||||
if args.debug:
|
||||
stdout_handler.setLevel(logging.DEBUG)
|
||||
|
||||
dest = (
|
||||
args.repository
|
||||
if args.remote_host is None
|
||||
else f"{args.remote_host}@{os.getlogin()}:{args.port}{args.repository}"
|
||||
)
|
||||
|
||||
syslog.debug(f"Repository destination: {dest}")
|
||||
|
||||
try:
|
||||
parsed_config = config.parse_configfile()
|
||||
repo = Repository(dest)
|
||||
@ -147,12 +155,6 @@ if __name__ == "__main__":
|
||||
else:
|
||||
script.do_backup(repo, parsed_config, args)
|
||||
|
||||
if args.verbose:
|
||||
stdout_handler.setLevel(logging.INFO)
|
||||
|
||||
if args.debug:
|
||||
stdout_handler.setLevel(logging.DEBUG)
|
||||
|
||||
if args.run_post_sync:
|
||||
syslog.info("Running sync operation")
|
||||
os.sync()
|
||||
|
Loading…
x
Reference in New Issue
Block a user