Skip to content

Commit

Permalink
move check for partial backups after setting backup mode with auto fu…
Browse files Browse the repository at this point in the history
…nction
  • Loading branch information
abbbi committed Jan 31, 2022
1 parent 6a69e87 commit f7585a8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions qmpbackup
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,6 @@ async def main():
)
sys.exit(1)

if argv.level == "inc":
targetdir = f"{backupdir}/{device.node}"
if os.path.exists(targetdir):
if len(glob(f"{targetdir}/*.partial")) > 0:
log.error(
"Partial backup found in [%s], possible broken backup chain. Exectue new full backup",
targetdir,
)
sys.exit(1)

if argv.level == "auto":
if (
device.has_bitmap
Expand All @@ -261,6 +251,16 @@ async def main():

log.info("Auto backup mode set to: %s", argv.level)

if argv.level == "inc":
targetdir = f"{backupdir}/{device.node}"
if os.path.exists(targetdir):
if len(glob(f"{targetdir}/*.partial")) > 0:
log.error(
"Partial backup found in [%s], possible broken backup chain. Exectue new full backup",
targetdir,
)
sys.exit(1)

log.info("Backup target directory: %s", backupdir)

qga = False
Expand Down

0 comments on commit f7585a8

Please sign in to comment.