Options and Parameters

Configuration

Crestic uses a distinct INI file syntax to that maps to special command line arguments:

Option Arguments

To give a commandline option argument, just provide the option keyword and value.

[home.backup]
exclude: *.secret

is mapped to

restic backup --exclude *.secret

Positional Arguments

This syntax was changed in version 0.8.0. Previously, the key was called arguments:

Positional arguments are given using the _arguments: key:

[home.backup]
_arguments: ~

Repeating Options

To give a commandline option more than once, use a multi line config value:

[home.backup]
exclude: *.secret
   *.bin

is mapped to

restic backup --exclude *.secret --exclude *.bin

Option Switches

This syntax was changed in version 0.7.0. Previously, a following colon was required.

To give an empty commandline option (a switch option), just provide the word without a following colon (:) or equal sign (=)

[home.backup]
verbose

is mapped to

restic backup --verbose

Empty String Options

This behaviour was added in version 1.0.0. Previously this syntax resulted in an option switch.

To give an empty string ("") commandline option, provide the word with an empty value:

[home.backup]
group-by:

is mapped to

restic backup --group-by ''

Environment Variables

Environment variables can be set using the [preset.environ] section.

[home.environ]
B2_ACCOUNT_ID: <MY_APPLICATION_KEY_ID>
B2_ACCOUNT_KEY: <MY_APPLICATION_KEY>

Command Aliases

The _command: key was introduced in version 0.8.0.

You can define command aliases by using the _command: key, e.g.

[home.my_alias]
_command: backup

will allow you to run crestic home my_alias, which is then mapped to restic backup.

Working Directory

The _workdir: key was introduced in version 0.8.0.

You can set a working directory using the _workdir: key, e.g.

[home.backup]
_workdir: ~

which will cause restic to be run in that directory. All other paths will be relative to this directory.

However, it is recommended to use absolute paths wherever possible because the backup path will be saved in the backup while the working directory does not. Using relative paths may then cause ambiguity and confusion.