mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-11 14:42:37 +08:00
Don't check for recent backup if --force is goven
This commit is contained in:
parent
729a2a7c1f
commit
c0c3cb78b4
1 changed files with 18 additions and 17 deletions
|
|
@ -1076,23 +1076,24 @@ class NPBackupRunner:
|
||||||
"backup_opts.additional_backup_only_parameters"
|
"backup_opts.additional_backup_only_parameters"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check if backup is required, no need to be verbose, but we'll make sure we don't get a json result here
|
if not force:
|
||||||
self.restic_runner.verbose = False
|
# Check if backup is required, no need to be verbose, but we'll make sure we don't get a json result here
|
||||||
json_output = self.json_output
|
self.restic_runner.verbose = False
|
||||||
self.json_output = False
|
json_output = self.json_output
|
||||||
# Since we don't want to close queues nor create a subthread, we need to change behavior here
|
self.json_output = False
|
||||||
# pylint: disable=E1123 (unexpected-keyword-arg)
|
# Since we don't want to close queues nor create a subthread, we need to change behavior here
|
||||||
has_recent_snapshots, backup_tz = self.has_recent_snapshot(
|
# pylint: disable=E1123 (unexpected-keyword-arg)
|
||||||
__close_queues=False, __no_threads=True
|
has_recent_snapshots, _ = self.has_recent_snapshot(
|
||||||
)
|
__close_queues=False, __no_threads=True
|
||||||
self.json_output = json_output
|
)
|
||||||
# We also need to "reapply" the json setting to backend
|
self.json_output = json_output
|
||||||
self.restic_runner.json_output = json_output
|
# We also need to "reapply" the json setting to backend
|
||||||
if has_recent_snapshots and not force:
|
self.restic_runner.json_output = json_output
|
||||||
msg = "No backup necessary"
|
if has_recent_snapshots:
|
||||||
self.write_logs(msg, level="info")
|
msg = "No backup necessary"
|
||||||
return self.convert_to_json_output(True, msg)
|
self.write_logs(msg, level="info")
|
||||||
self.restic_runner.verbose = self.verbose
|
return self.convert_to_json_output(True, msg)
|
||||||
|
self.restic_runner.verbose = self.verbose
|
||||||
|
|
||||||
# Run backup here
|
# Run backup here
|
||||||
if not read_from_stdin:
|
if not read_from_stdin:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue