pub struct CreateOptions {Show 17 fields
pub repository: String,
pub archive: String,
pub passphrase: Option<String>,
pub comment: Option<String>,
pub compression: Option<CompressionMode>,
pub paths: Vec<String>,
pub exclude_caches: bool,
pub patterns: Vec<PatternInstruction>,
pub pattern_file: Option<String>,
pub excludes: Vec<Pattern>,
pub exclude_file: Option<String>,
pub numeric_ids: bool,
pub sparse: bool,
pub read_special: bool,
pub no_xattrs: bool,
pub no_acls: bool,
pub no_flags: bool,
}
Expand description
The options for a borg create command
Fields§
§repository: String
Path to the repository
Example values:
/tmp/foo
user@example.com:/opt/repo
ssh://user@example.com:2323:/opt/repo
archive: String
Name of archive to create (must be also a valid directory name)
The archive name needs to be unique. It must not end in ‘.checkpoint’ or ‘.checkpoint.N’ (with N being a number), because these names are used for checkpoints and treated in special ways.
In the archive name, you may use the following placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others.
See https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-patterns for further information.
passphrase: Option<String>
The passphrase for the repository
If using a repository with EncryptionMode::None, you can leave this option empty
comment: Option<String>
Add a comment text to the archive
compression: Option<CompressionMode>
Specify the compression mode that should be used.
Defaults to CompressionMode::Lz4.
paths: Vec<String>
The paths to archive.
All given paths will be recursively traversed.
exclude_caches: bool
Exclude directories that contain a CACHEDIR.TAG file (http://www.bford.info/cachedir/spec.html)
patterns: Vec<PatternInstruction>
The patterns to apply
Using these, you may specify the backup roots (starting points) and patterns for inclusion/exclusion.
See PatternInstruction for further information.
Note that the order of the instructions is important:
# backup pics, but not the ones from 2018, except the good ones:
borg create --pattern=+pics/2018/good --pattern=-pics/2018 repo::arch pics
pattern_file: Option<String>
read include/exclude patterns from the given path, one per line
Refer to https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-help-patterns for further information how to use pattern / exclude files.
excludes: Vec<Pattern>
Exclude paths matching PATTERN.
See Pattern for further information.
exclude_file: Option<String>
read exclude patterns from the given path, one per line
Refer to https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-help-patterns for further information how to use pattern / exclude files.
numeric_ids: bool
Only store numeric user and group identifiers
sparse: bool
Detect sparse holes in input (supported only by fixed chunker)
read_special: bool
Open and read block and char device files as well as FIFOs as if they were regular files.
Also follows symlinks pointing to these kinds of files.
no_xattrs: bool
Do not read and store xattrs into archive
no_acls: bool
Do not read and store ACLs into archive
no_flags: bool
Do not read and store flags (e.g. NODUMP, IMMUTABLE) into archive
Implementations§
Source§impl CreateOptions
impl CreateOptions
Sourcepub fn new(
repository: String,
archive: String,
paths: Vec<String>,
patterns: Vec<PatternInstruction>,
) -> Self
pub fn new( repository: String, archive: String, paths: Vec<String>, patterns: Vec<PatternInstruction>, ) -> Self
Create an new CreateOptions
Trait Implementations§
Source§impl Clone for CreateOptions
impl Clone for CreateOptions
Source§fn clone(&self) -> CreateOptions
fn clone(&self) -> CreateOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more