ceph/scripts/prune_logs.py
Zack Cerza a1079e6fc3 Add teuthology-prune-logs
Signed-off-by: Zack Cerza <zack@redhat.com>
2015-09-24 14:07:35 -06:00

34 lines
1.1 KiB
Python

import docopt
import teuthology.config
import teuthology.prune
doc = """
usage:
teuthology-prune-logs -h
teuthology-prune-logs [-v] [options]
Prune old logfiles from the archive
optional arguments:
-h, --help Show this help message and exit
-v, --verbose Be more verbose
-a ARCHIVE, --archive ARCHIVE
The base archive directory
[default: {archive_base}]
--dry-run Don't actually delete anything; just log what would be
deleted
-p DAYS, --pass DAYS Remove all logs for jobs which passed and are older
than DAYS. Negative values will skip this operation.
[default: 14]
-r DAYS, --remotes DAYS
Remove the 'remote' subdir of jobs older than DAYS.
Negative values will skip this operation.
[default: 60]
""".format(archive_base=teuthology.config.config.archive_base)
def main():
args = docopt.docopt(doc)
teuthology.prune.main(args)