Learn R Programming

rotor (version 0.3.4)

BackupQueue: An R6 Class for managing backups (abstract base class)

Description

BackupQueueis an abstract class not intended for direct usage, please refer to BackupQueueIndex, BackupQueueDateTime, BackupQueueDate instead.

Arguments

Super class

rotor::DirectoryQueue -> BackupQueue

Public fields

dir

character scalar. Directory in which to place the backups.

n

integer scalar. The number of backups that exist for BackupQueue$origin

Active bindings

dir

character scalar. Directory in which to place the backups.

n

integer scalar. The number of backups that exist for BackupQueue$origin

file

character scalar. The file to backup/rotate.

compression

(Optional) compression to use compression argument of rotate().

max_backups

Maximum number/size/age of backups. See max_backups argument of rotate()

has_backups

Returns TRUE if at least one backup of BackupQueue$origin exists All backups of self$origin

Methods

Public methods

Method new()

Usage

BackupQueue$new(
  origin,
  dir = dirname(origin),
  max_backups = Inf,
  compression = FALSE,
  backup_dir = NULL
)

Method prune()

Delete all backups except max_backups. See prune_backups().

Usage

BackupQueue$prune(max_backups = self$max_backups)

Method prune_identical()

Delete all identical backups. Uses tools::md5sum() to compare the files. Set the file to be backed up

Usage

BackupQueue$prune_identical()

Method print()

Usage

BackupQueue$print()

Method push_backup()

Usage

BackupQueue$push_backup(...)

Method set_origin()

Usage

BackupQueue$set_origin(x)

Arguments

x

a character scalar. Path to a file Set the file to be backed up

Method set_compression()

Usage

BackupQueue$set_compression(x)

Arguments

x

a character scalar. Path to a file

Method set_max_backups()

Usage

BackupQueue$set_max_backups(x)

Method set_file()

Usage

BackupQueue$set_file(x)

Method set_backup_dir()

Usage

BackupQueue$set_backup_dir(x)

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()).

See Also

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