A BackupQueue for timestamped backups, e.g. foo.log, foo.2020-07-24_10-54-30.log

## Details

This class is part of the R6 API of rotor which is intended for developers that want to extend this package. For normal usage, the simpler functional API is recommended (see rotate()).

Other R6 Classes: BackupQueueDate, BackupQueueIndex, BackupQueue, Cache, DirectoryQueue

## Super classes

rotor::DirectoryQueue -> rotor::BackupQueue -> BackupQueueDateTime

## Active bindings

fmt

See format argument of rotate_date() logical scalar. If TRUE (the default) the list of backups is cached, if FALSE it is read from disk every time this appender triggers. Caching brings a significant speedup for checking whether to rotate or not based on the age of the last backup, but is only safe if there are no other programs/functions interacting with the backups. This is only advantageous for high frequency file rotation (i.e. several times per second) POSIXct scalar. Timestamp of the last rotation (the last backup)

## Methods

### Public methods

Inherited methods

### Method new()

#### Arguments

overwrite

logical scalar. Overwrite backups with the same filename (i.e timestamp)?

now

POSIXct scalar. Can be used as an override mechanism for the current system time if necessary.

### Method prune()

#### Usage

BackupQueueDateTime$prune(max_backups = self$max_backups)

### Method should_rotate()

Should a file of size and age be rotated? See size and age arguments of rotate_date(). now overrides the current system time, last_rotation overrides the date of the last rotation.

#### Usage

BackupQueueDateTime$should_rotate( size, age, now = Sys.time(), last_rotation = self$last_rotation %||% file.info(self$origin)$ctime,
verbose = FALSE
)

#### Returns

TRUE or FALSE

### Method set_cache_backups()

#### Usage

BackupQueueDateTime\$set_cache_backups(x)`