X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fbackupninja;h=1c2d71c26cdce22620c60ed7c3494cec0d14c7bc;hb=52ce78d1bf9e1344b9fc27cae81c158580579b34;hp=48330b3a6a28943e8167b4447aa844ff36141649;hpb=38783916e32faa5653f43620f9e31acc9418721e;p=matthijs%2Fprojects%2Fbackupninja.git diff --git a/src/backupninja b/src/backupninja index 48330b3..1c2d71c 100755 --- a/src/backupninja +++ b/src/backupninja @@ -28,13 +28,42 @@ import sys from backupninja.log import setup_logging from backupninja import config +from backupninja import action log = logging.getLogger() def make_option_parser(): description = """%prog checks for scheduled actions and runs them when needed.""" parser = optparse.OptionParser(description=description) - + parser.add_option( "-c", "--confdir" + , help="Load configuration from CONFIG_DIR " + "instead of '%default'. When " + "the --conffile or --actionsdir options " + "specify relative paths, they are taken " + "relative to this directory." + , default="/etc/backupninja" + , dest="config_dir" + , metavar="CONFIG_DIR") + parser.add_option( "-f", "--conffile" + , help="Load the main configuration from FILE instead " + "of '%default'. If FILE is a relative path, it " + "is interpreted relative to CONFIG_DIR." + , default='backupninja.conf' + , dest="global_config" + , metavar="FILE") + parser.add_option( "-a", "--actionsdir" + , help="Load action configurations from ACTIONS_DIR " + "instead of '%default'. If ACTIONS_DIR is a " + "relative path, it is interpreted relative to " + "CONFIG_DIR." + , default="actions" + , dest="actions_dir" + , metavar="ACTIONS_DIR") + parser.add_option( "-d", "--debug" + , help="Run in debug mode. This only means logging is " + "more verbose." + , action="store_true" + , dest="debug") return parser def main(argv): @@ -53,7 +82,7 @@ def main(argv): return 1 # Process command - parser.print_help() + action.run_all_actions(options, global_conf) return 0