""" Running backup actions """
+import logging as log
+
from backupninja import config
from backupninja import handlers
global configuration.
"""
actions = config.list_actions(opts)
+ actions.sort()
for action in actions:
run_action(action, opts, global_config)
# Get the config for this action
action_config = config.get_action_config(opts, action)
- # Create a handler for this action
- handler = handlers.create_handler(action_ty, action_config)
- if handler:
- # Run the handler
+ try:
+ # Create a handler for this action
+ handler = handlers.create_handler(action_ty, action_config)
+ # Run it
handler.run()
handler.finish()
- # Silently skip invalid handlers, create_handler will have
- # logged an error
+ except Exception, e:
+ log.error('Running action "%s" failed: %s', action, e)