From de0862a3dd8002d9bc94f71ab9a1318ca8bd9677 Mon Sep 17 00:00:00 2001 From: Boris Bera Date: Sun, 1 Dec 2024 14:43:29 -0500 Subject: [PATCH] doc(lock): add lockfile doc with customization explanation --- docs/pages/_meta.json | 1 + docs/pages/cli/general.md | 2 +- docs/pages/lockfile.md | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 docs/pages/lockfile.md diff --git a/docs/pages/_meta.json b/docs/pages/_meta.json index 74856dc..7e38ca7 100644 --- a/docs/pages/_meta.json +++ b/docs/pages/_meta.json @@ -3,6 +3,7 @@ "quick": "Quick Start", "installation": "Installation", "config": "Configuration", + "lockfile": "Lockfile", "location": "Locations", "backend": "Backend", "cli": "CLI", diff --git a/docs/pages/cli/general.md b/docs/pages/cli/general.md index e9fad29..e653c77 100644 --- a/docs/pages/cli/general.md +++ b/docs/pages/cli/general.md @@ -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 diff --git a/docs/pages/lockfile.md b/docs/pages/lockfile.md new file mode 100644 index 0000000..ca111f0 --- /dev/null +++ b/docs/pages/lockfile.md @@ -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.