trim_backups | R Documentation |
trim_backups()
deletes old backup files from a directory. More
specifically, it identifies files in a directory
with a common naming
pattern
and it keeps the most recent of those files. To be deleted, a file
not be one of the min_backups
newest files, and it must be older
than min_date
. This ensures that at least min_backups
backups
are always retained while keeping any additional backups created on or after
min_date
. The defaults are chosen so that at least 7 backups over at least
the past 7 days are kept.
trim_backups( directory, pattern = NULL, min_backups = 7, min_date = Sys.Date() - min_backups + 1 )
directory |
The path to the backup directory |
pattern |
The naming pattern of the backup files, as a regular
expression. This allows maintenance of backups when other files are also
present in the |
min_backups |
The minimum number of backups to keep |
min_date |
The date after which to keep all backups. The default is set
to keep files for |
The deleted paths (invisibly)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.