pub struct Checkpoints {
pub interval_secs: Option<u64>,
pub directory: Option<PathBuf>,
pub keep: usize,
}Expand description
Taking a checkpoint on a schedule, and keeping the last few.
Run by the maintenance thread, beside the flush, compaction, rollup and
retention passes — the deployments this is for have no scheduler of their
own. Off unless interval_secs is set.
[database.checkpoints]
interval_secs = 21600 # every six hours
directory = "/mnt/backup/chronix"
keep = 4 # a day of historyEach run writes <directory>/<timestamp>; the oldest are removed once
more than keep remain, and a run with no manifest is removed on sight.
A failed run leaves the existing checkpoints alone and increments
chronix_backup_failures_total.
directory must be outside the data directory’s segments/ tree. On the
same filesystem the segments are hard-linked, so the checkpoint is not a
second copy of the bytes — point it at a different volume if surviving
that volume is the aim.
Fields§
§interval_secs: Option<u64>How often to take one. None — the default — is off.
directory: Option<PathBuf>Where they go. Required when interval_secs is set.
keep: usizeHow many to keep. Default 3; 0 keeps only the newest.
Implementations§
Source§impl Checkpoints
impl Checkpoints
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Check the declaration is usable.
§Errors
ConfigError::Validation if an interval is set without a
directory — the one combination that reads as “on” and does nothing.
Trait Implementations§
Source§impl Clone for Checkpoints
impl Clone for Checkpoints
Source§fn clone(&self) -> Checkpoints
fn clone(&self) -> Checkpoints
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more