|
|
|
@ -14,7 +14,10 @@ from openwrt_backup.prune import get_all_but_last_n |
|
|
|
|
|
|
|
|
|
|
|
def do_prune(dest_path: Path, n: int, dry, hostname=None): |
|
|
|
to_delete = get_all_but_last_n(dest_path, n, hostname) |
|
|
|
if dry: |
|
|
|
to_delete = get_all_but_last_n(dest_path, n - 1, hostname) |
|
|
|
else: |
|
|
|
to_delete = get_all_but_last_n(dest_path, n, hostname) |
|
|
|
for f in to_delete: |
|
|
|
if dry: |
|
|
|
print(f"Deleting: {f}") |
|
|
|
|