Better than Rafael's hack is the following: in common/snapshots.py, take_snapshot returns a success status. This function is called by the take_snapshot function in common/backintime.py, but the return value is ignored. So instead, take_snapshot in common/backintime.py should read:
def take_snapshot( cfg, force = True ):
logger.openlog()
tools.load_env(cfg)
ret = snapshots.Snapshots( cfg ).take_snapshot( force )
logger.closelog()
return ret
and then in the start_app loop in common/backintime.py do something like the following:
if arg == '--backup' or arg == '-b':
ret = take_snapshot( cfg, True )
if ret: sys.exit(0)
else: sys.exit(1)
if arg == '--backup-job':
ret = take_snapshot( cfg, False )
if ret: sys.exit(0)
else: sys.exit(1)
Better than Rafael's hack is the following: in common/ snapshots. py, take_snapshot returns a success status. This function is called by the take_snapshot function in common/ backintime. py, but the return value is ignored. So instead, take_snapshot in common/ backintime. py should read:
def take_snapshot( cfg, force = True ): openlog( ) load_env( cfg) Snapshots( cfg ).take_snapshot( force ) closelog( )
logger.
tools.
ret = snapshots.
logger.
return ret
and then in the start_app loop in common/ backintime. py do something like the following:
if arg == '--backup' or arg == '-b':
sys.exit( 0)
sys.exit( 1)
ret = take_snapshot( cfg, True )
if ret:
else:
if arg == '--backup-job':
sys.exit( 0)
sys.exit( 1)
ret = take_snapshot( cfg, False )
if ret:
else: