|
@@ -5,7 +5,7 @@ import logging
|
|
from operator import attrgetter
|
|
from operator import attrgetter
|
|
import re
|
|
import re
|
|
|
|
|
|
-from ._common import with_repository
|
|
|
|
|
|
+from ._common import with_repository, Highlander
|
|
from ..archive import Archive, Statistics
|
|
from ..archive import Archive, Statistics
|
|
from ..cache import Cache
|
|
from ..cache import Cache
|
|
from ..constants import * # NOQA
|
|
from ..constants import * # NOQA
|
|
@@ -257,6 +257,7 @@ class PruneMixIn:
|
|
metavar="INTERVAL",
|
|
metavar="INTERVAL",
|
|
dest="within",
|
|
dest="within",
|
|
type=interval,
|
|
type=interval,
|
|
|
|
+ action=Highlander,
|
|
help="keep all archives within this time interval",
|
|
help="keep all archives within this time interval",
|
|
)
|
|
)
|
|
subparser.add_argument(
|
|
subparser.add_argument(
|
|
@@ -265,25 +266,61 @@ class PruneMixIn:
|
|
dest="secondly",
|
|
dest="secondly",
|
|
type=int,
|
|
type=int,
|
|
default=0,
|
|
default=0,
|
|
|
|
+ action=Highlander,
|
|
help="number of secondly archives to keep",
|
|
help="number of secondly archives to keep",
|
|
)
|
|
)
|
|
subparser.add_argument(
|
|
subparser.add_argument(
|
|
- "--keep-minutely", dest="minutely", type=int, default=0, help="number of minutely archives to keep"
|
|
|
|
|
|
+ "--keep-minutely",
|
|
|
|
+ dest="minutely",
|
|
|
|
+ type=int,
|
|
|
|
+ default=0,
|
|
|
|
+ action=Highlander,
|
|
|
|
+ help="number of minutely archives to keep",
|
|
)
|
|
)
|
|
subparser.add_argument(
|
|
subparser.add_argument(
|
|
- "-H", "--keep-hourly", dest="hourly", type=int, default=0, help="number of hourly archives to keep"
|
|
|
|
|
|
+ "-H",
|
|
|
|
+ "--keep-hourly",
|
|
|
|
+ dest="hourly",
|
|
|
|
+ type=int,
|
|
|
|
+ default=0,
|
|
|
|
+ action=Highlander,
|
|
|
|
+ help="number of hourly archives to keep",
|
|
)
|
|
)
|
|
subparser.add_argument(
|
|
subparser.add_argument(
|
|
- "-d", "--keep-daily", dest="daily", type=int, default=0, help="number of daily archives to keep"
|
|
|
|
|
|
+ "-d",
|
|
|
|
+ "--keep-daily",
|
|
|
|
+ dest="daily",
|
|
|
|
+ type=int,
|
|
|
|
+ default=0,
|
|
|
|
+ action=Highlander,
|
|
|
|
+ help="number of daily archives to keep",
|
|
)
|
|
)
|
|
subparser.add_argument(
|
|
subparser.add_argument(
|
|
- "-w", "--keep-weekly", dest="weekly", type=int, default=0, help="number of weekly archives to keep"
|
|
|
|
|
|
+ "-w",
|
|
|
|
+ "--keep-weekly",
|
|
|
|
+ dest="weekly",
|
|
|
|
+ type=int,
|
|
|
|
+ default=0,
|
|
|
|
+ action=Highlander,
|
|
|
|
+ help="number of weekly archives to keep",
|
|
)
|
|
)
|
|
subparser.add_argument(
|
|
subparser.add_argument(
|
|
- "-m", "--keep-monthly", dest="monthly", type=int, default=0, help="number of monthly archives to keep"
|
|
|
|
|
|
+ "-m",
|
|
|
|
+ "--keep-monthly",
|
|
|
|
+ dest="monthly",
|
|
|
|
+ type=int,
|
|
|
|
+ default=0,
|
|
|
|
+ action=Highlander,
|
|
|
|
+ help="number of monthly archives to keep",
|
|
)
|
|
)
|
|
subparser.add_argument(
|
|
subparser.add_argument(
|
|
- "-y", "--keep-yearly", dest="yearly", type=int, default=0, help="number of yearly archives to keep"
|
|
|
|
|
|
+ "-y",
|
|
|
|
+ "--keep-yearly",
|
|
|
|
+ dest="yearly",
|
|
|
|
+ type=int,
|
|
|
|
+ default=0,
|
|
|
|
+ action=Highlander,
|
|
|
|
+ help="number of yearly archives to keep",
|
|
)
|
|
)
|
|
define_archive_filters_group(subparser, sort_by=False, first_last=False)
|
|
define_archive_filters_group(subparser, sort_by=False, first_last=False)
|
|
subparser.add_argument(
|
|
subparser.add_argument(
|
|
@@ -293,5 +330,6 @@ class PruneMixIn:
|
|
dest="checkpoint_interval",
|
|
dest="checkpoint_interval",
|
|
type=int,
|
|
type=int,
|
|
default=1800,
|
|
default=1800,
|
|
|
|
+ action=Highlander,
|
|
help="write checkpoint every SECONDS seconds (Default: 1800)",
|
|
help="write checkpoint every SECONDS seconds (Default: 1800)",
|
|
)
|
|
)
|