Skip to content

Commit

Permalink
doc(lock): add lockfile doc with customization explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
dotboris committed Dec 1, 2024
1 parent c9a1474 commit de0862a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"quick": "Quick Start",
"installation": "Installation",
"config": "Configuration",
"lockfile": "Lockfile",
"location": "Locations",
"backend": "Backend",
"cli": "CLI",
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/cli/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ autorestic --restic-bin /some/path/to/my/custom/restic/binary

## `--lockfile-path`

Specify the path for the lockfile used by `autorestic`. If omitted, this will default to `.autorestic.lock.yml` next to the loaded config file.
Specify the path for the [lockfile](../lockfile.md) used by `autorestic`. If omitted, this will default to `.autorestic.lock.yml` next to the loaded config file.

```bash
autorestic --lockfile-path /path/to/my/.autorestic.lock.yml
Expand Down
14 changes: 14 additions & 0 deletions docs/pages/lockfile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Lockfile

Under the hood, `autorestic` uses a lockfile to ensure that only one instance is running and to keep track of when [cronjobs](./location/cron.md) were last run.

By default, the lockfile is stored next to your [configuration file](./config.md) as `.autorestic.lock.yml`. In other words, if your config file is located at `/some/path/.autorestic.yml`, then the lockfile will be located at `/some/path/.autorestic.lock.yml`.

## Customization

The path to the lockfile can be customized if need be. This can be done is a few ways:

1. Using the `--lockfile-path ...` command line flag
1. Setting `lockfile: ...` in the configuration file

Note that `autorestic` will check for a customized lockfile path in the order listed above. This means that if you specify a lockfile path in multiple places, the method that's higher in the list will win.

0 comments on commit de0862a

Please sign in to comment.