Add argument to ignore delete threshold (#25)
This commit is contained in:
1 parent
6f8d170edc
commit
11affad8b7
2 files changed
+9
No files matched your search
@@ -165,6 +165,9 @@ def load_config(args):
|
||||
if args.scrub is not None:
|
||||
config["scrub"]["enabled"] = args.scrub
|
||||
|
||||
if args.ignore_deletethreshold:
|
||||
config["snapraid"]["deletethreshold"] = -1
|
||||
|
||||
|
||||
def setup_logger():
|
||||
log_format = logging.Formatter(
|
||||
@@ -208,6 +211,8 @@ def main():
|
||||
parser.add_argument("--no-scrub", action='store_false',
|
||||
dest='scrub', default=None,
|
||||
help="Do not scrub (overrides config)")
|
||||
parser.add_argument("--ignore-deletethreshold", action='store_true',
|
||||
help="Sync even if configured delete threshold is exceeded")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not os.path.exists(args.conf):
|
||||
@@ -271,6 +276,7 @@ def run():
|
||||
logging.error(
|
||||
"Deleted files exceed delete threshold of {}, aborting".format(
|
||||
config["snapraid"]["deletethreshold"]))
|
||||
logging.error("Run again with --ignore-deletethreshold to sync anyways")
|
||||
finish(False)
|
||||
|
||||
if (diff_results["remove"] + diff_results["add"] + diff_results["move"] +
|
||||
|
||||
Reference in new issue
Block a user