diff options
-rwxr-xr-x | example.py | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -8,11 +8,6 @@ from lbup.repository import Repo from lbup.ssh_remote import SSHRemote from lbup.targets import TargetLocal, TargetSSH, TargetSSHLXCLVM -# define the backup targets -tgts = ( - #TargetLocal('local', dirs = ['/usr/local/share']), -) - def list_targets(tgts): for tgt in tgts: sys.stdout.write('%s\n %s\n' % (tgt.name, str(tgt))) @@ -21,15 +16,22 @@ def list_targets(tgts): parser = argparse.ArgumentParser() parser.add_argument('-l', '--list-targets', action = 'store_true') parser.add_argument('-n', '--dry-run', action = 'store_true') +parser.add_argument('-v', '--verbose', action = 'count', default = 0) parser.add_argument('targets', nargs = argparse.REMAINDER) args = parser.parse_args() +# configure logging +logging.basicConfig(level = max(3 - args.verbose, 0) * 10) +# define the backup targets +tgts = ( + #TargetLocal('local', dirs = ['/usr/local/share']), +) + + if args.list_targets: list_targets(tgts) sys.exit(0) -logging.basicConfig(level = logging.INFO) - if len(args.targets) > 0: tgts_run = [] for requested in args.targets: |