|
@@ -96,9 +96,9 @@ def main(argv = None): |
|
|
parser.add_argument("-u", "--url", action="store", |
|
|
parser.add_argument("-u", "--url", action="store", |
|
|
default="http://localhost/nilmdb/", |
|
|
default="http://localhost/nilmdb/", |
|
|
help="NilmDB server URL (default: %(default)s)") |
|
|
help="NilmDB server URL (default: %(default)s)") |
|
|
parser.add_argument("-D", "--dry-run", action="store_true", |
|
|
|
|
|
|
|
|
parser.add_argument("-y", "--yes", action="store_true", |
|
|
default = False, |
|
|
default = False, |
|
|
help="Don't actually remove any data") |
|
|
|
|
|
|
|
|
help="Actually remove the data (default: no)") |
|
|
parser.add_argument("-e", "--estimate", action="store_true", |
|
|
parser.add_argument("-e", "--estimate", action="store_true", |
|
|
default = False, |
|
|
default = False, |
|
|
help="Estimate how much disk space will be used") |
|
|
help="Estimate how much disk space will be used") |
|
@@ -238,14 +238,16 @@ def main(argv = None): |
|
|
timestamp_to_seconds(total))) |
|
|
timestamp_to_seconds(total))) |
|
|
continue |
|
|
continue |
|
|
printf(" removing data before %s\n", timestamp_to_human(remove_before)) |
|
|
printf(" removing data before %s\n", timestamp_to_human(remove_before)) |
|
|
if not args.dry_run: |
|
|
|
|
|
|
|
|
if args.yes: |
|
|
client.stream_remove(path, None, remove_before) |
|
|
client.stream_remove(path, None, remove_before) |
|
|
for ap in streams[path].also_clean_paths: |
|
|
for ap in streams[path].also_clean_paths: |
|
|
printf(" also removing from %s\n", ap) |
|
|
printf(" also removing from %s\n", ap) |
|
|
if not args.dry_run: |
|
|
|
|
|
|
|
|
if args.yes: |
|
|
client.stream_remove(ap, None, remove_before) |
|
|
client.stream_remove(ap, None, remove_before) |
|
|
|
|
|
|
|
|
# All done |
|
|
# All done |
|
|
|
|
|
if not args.yes: |
|
|
|
|
|
printf("Note: specify --yes to actually perform removals\n") |
|
|
return |
|
|
return |
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
if __name__ == "__main__": |
|
|