forked from ceph/teuthology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprune_logs.py
33 lines (27 loc) · 1.06 KB
/
prune_logs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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)