Struct CreateOptions

Source
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

Source

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

Source§

fn clone(&self) -> CreateOptions

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CreateOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CreateOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,