From 6da78e42523365354ea0e7cc5fb563992f87505c Mon Sep 17 00:00:00 2001 From: remittor Date: Tue, 2 Nov 2021 18:37:22 +0300 Subject: [PATCH] Fix backup after try read locked partition --- create_backup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/create_backup.py b/create_backup.py index cd0b886..6467a59 100644 --- a/create_backup.py +++ b/create_backup.py @@ -93,7 +93,11 @@ else: os.rename(fn_local, fn_old) gw.run_cmd("dd if=/dev/mtd{id} of={o}".format(id=p, o=fn_remote)) print('Download dump to file "./{}"...'.format(fn_local)) - gw.download(fn_remote, fn_local, verbose = 0) + try: + gw.download(fn_remote, fn_local, verbose = 0) + except Exception: + print('Remote file "{}" not found!'.format(fn_remote)) + continue gw.run_cmd("rm -f " + fn_remote) print('Backup of "{}" saved to file "./{}"'.format(name, fn_local)) print(" ")