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
@@ -37,6 +37,9 @@ feature you are missing, you can have a look
|
|||||||
[at the open PRs](https://github.com/Chronial/snapraid-runner/pulls).
|
[at the open PRs](https://github.com/Chronial/snapraid-runner/pulls).
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
### Unreleased
|
||||||
|
* Add --ignore-deletethreshold (by exterrestris, #25)
|
||||||
|
|
||||||
### v0.5 (26 Feb 2021)
|
### v0.5 (26 Feb 2021)
|
||||||
* Remove (broken) python2 support
|
* Remove (broken) python2 support
|
||||||
* Fix snapraid output encoding handling (by hyyz17200, #31)
|
* Fix snapraid output encoding handling (by hyyz17200, #31)
|
||||||
|
|||||||
@@ -165,6 +165,9 @@ def load_config(args):
|
|||||||
if args.scrub is not None:
|
if args.scrub is not None:
|
||||||
config["scrub"]["enabled"] = args.scrub
|
config["scrub"]["enabled"] = args.scrub
|
||||||
|
|
||||||
|
if args.ignore_deletethreshold:
|
||||||
|
config["snapraid"]["deletethreshold"] = -1
|
||||||
|
|
||||||
|
|
||||||
def setup_logger():
|
def setup_logger():
|
||||||
log_format = logging.Formatter(
|
log_format = logging.Formatter(
|
||||||
@@ -208,6 +211,8 @@ def main():
|
|||||||
parser.add_argument("--no-scrub", action='store_false',
|
parser.add_argument("--no-scrub", action='store_false',
|
||||||
dest='scrub', default=None,
|
dest='scrub', default=None,
|
||||||
help="Do not scrub (overrides config)")
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if not os.path.exists(args.conf):
|
if not os.path.exists(args.conf):
|
||||||
@@ -271,6 +276,7 @@ def run():
|
|||||||
logging.error(
|
logging.error(
|
||||||
"Deleted files exceed delete threshold of {}, aborting".format(
|
"Deleted files exceed delete threshold of {}, aborting".format(
|
||||||
config["snapraid"]["deletethreshold"]))
|
config["snapraid"]["deletethreshold"]))
|
||||||
|
logging.error("Run again with --ignore-deletethreshold to sync anyways")
|
||||||
finish(False)
|
finish(False)
|
||||||
|
|
||||||
if (diff_results["remove"] + diff_results["add"] + diff_results["move"] +
|
if (diff_results["remove"] + diff_results["add"] + diff_results["move"] +
|
||||||
|
|||||||
Reference in new issue
Block a user