In rotor, an interval is a character string in the form
"<number> <interval>"
. The following intervals are possible:
"day(s)"
, "week(s)"
, "month(s)"
, "quarter(s)"
, "year(s)"
.
The plural "s"
is optional (so "2 weeks"
and "2 week"
are equivalent).
Please be aware that weeks are
ISOweeks
and start on Monday (not Sunday as in some countries).
Interval strings can be used as arguments when backing up or rotating files,
or for pruning backup queues (i.e. limiting the number of backups of a
single) file.
When rotating/backing up "1 months"
means "make a new backup if the last
backup is from the preceding month". E.g if the last backup of myfile
is from 2019-02-01
then backup_time(myfile, age = "1 month")
will only
create a backup if the current date is at least 2019-03-01
.
When pruning/limiting backup queues, "1 year"
means "keep at least most
one year worth of backups". So if you call
backup_time(myfile, max_backups = "1 year")
on 2019-03-01
, it will create
a backup and then remove all backups of myfile
before 2019-01-01
.