pub struct PruneOptions {
pub repository: String,
pub passphrase: Option<String>,
pub keep_within: Option<PruneWithin>,
pub keep_secondly: Option<NonZeroU16>,
pub keep_minutely: Option<NonZeroU16>,
pub keep_hourly: Option<NonZeroU16>,
pub keep_daily: Option<NonZeroU16>,
pub keep_weekly: Option<NonZeroU16>,
pub keep_monthly: Option<NonZeroU16>,
pub keep_yearly: Option<NonZeroU16>,
pub checkpoint_interval: Option<NonZeroU16>,
pub glob_archives: Option<String>,
}
Expand description
Options for crate::sync::prune
A good procedure is to thin out more and more the older your backups get.
As an example, keep_daily
7 means to keep the latest backup on each day, up to 7 most
recent days with backups (days without backups do not count). The rules are applied from
secondly to yearly, and backups selected by previous rules do not count towards those of
later rules. The time that each backup starts is used for pruning purposes.
Dates and times are interpreted in the local timezone, and weeks go from Monday to Sunday.
Specifying a negative number of archives to keep means that there is no limit.
As of borg 1.2.0, borg will retain the oldest archive if any of the secondly, minutely, hourly, daily, weekly, monthly, or yearly rules was not otherwise able to meet its retention target. This enables the first chronological archive to continue aging until it is replaced by a newer archive that meets the retention criteria.
Fields§
§repository: String
Path to the repository
Example values:
/tmp/foo
user@example.com:/opt/repo
ssh://user@example.com:2323:/opt/repo
passphrase: Option<String>
The passphrase for the repository
If using a repository with EncryptionMode::None, you can leave this option empty
keep_within: Option<PruneWithin>
The archives kept with this option do not count towards the totals specified by any other options.
keep_secondly: Option<NonZeroU16>
number of secondly archives to keep
keep_minutely: Option<NonZeroU16>
number of minutely archives to keep
keep_hourly: Option<NonZeroU16>
number of hourly archives to keep
keep_daily: Option<NonZeroU16>
number of daily archives to keep
keep_weekly: Option<NonZeroU16>
number of weekly archives to keep
keep_monthly: Option<NonZeroU16>
number of monthly archives to keep
keep_yearly: Option<NonZeroU16>
number of yearly archives to keep
checkpoint_interval: Option<NonZeroU16>
write checkpoint every SECONDS seconds (Default: 1800)
glob_archives: Option<String>
only consider archive names matching the glob.
The pattern can use Pattern::Shell
Implementations§
Source§impl PruneOptions
impl PruneOptions
Sourcepub fn new(repository: String) -> Self
pub fn new(repository: String) -> Self
Create an new PruneOptions
Trait Implementations§
Source§impl Clone for PruneOptions
impl Clone for PruneOptions
Source§fn clone(&self) -> PruneOptions
fn clone(&self) -> PruneOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more