diff --git a/bin/backup b/bin/backup index 56a6367..d82bc4d 100644 --- a/bin/backup +++ b/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()