This commit is contained in:
cupcakearmy 2020-11-13 15:48:20 +01:00
parent b690c1c3a9
commit 91e902d7ef
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9
9 changed files with 47 additions and 13 deletions

View File

@ -19,6 +19,7 @@
> :Collapse label=CLI > :Collapse label=CLI
> >
> [General](/cli/general)
> [Info](/cli/info) > [Info](/cli/info)
> [Check](/cli/check) > [Check](/cli/check)
> [Backup](/cli/backup) > [Backup](/cli/backup)

View File

@ -4,7 +4,7 @@
autorestic backup [-l, --location] [-a, --all] autorestic backup [-l, --location] [-a, --all]
``` ```
Performes a backup of all locations if the `-a` flag is passed. To only backup some locations pass one or more `-l` or `--location` flags. Performs a backup of all locations if the `-a` flag is passed. To only backup some locations pass one or more `-l` or `--location` flags.
```bash ```bash
autorestic backup -l my-location autorestic backup -l my-location

View File

@ -1,4 +1,4 @@
# check # Check
```bash ```bash
autorestic check [-b, --backend] [-a, --all] autorestic check [-b, --backend] [-a, --all]

View File

@ -4,7 +4,7 @@
autorestic cron autorestic cron
``` ```
This command is modtly intended to be triggered by an automated system like systemd or crontab. This command is mostly intended to be triggered by an automated system like systemd or crontab.
It will run cron jobs es [specified in the cron section](/locations/cron) of a specific location. It will run cron jobs es [specified in the cron section](/locations/cron) of a specific location.

View File

@ -10,6 +10,6 @@ This is avery handy command which enables you to run any native restic command o
autorestic exec -a -- snapshots autorestic exec -a -- snapshots
``` ```
With `exec` you can basically run every cli command that you would be able to run with the restic cli. It only prefillst path, key, etc. With `exec` you can basically run every cli command that you would be able to run with the restic cli. It only pre-fills path, key, etc.
> :ToCPrevNext > :ToCPrevNext

29
docs/cli/general.md Normal file
View File

@ -0,0 +1,29 @@
# General
## `--version`
Prints the current version
```bash
autorestic --version
```
## `--c, --config`
Specify the config file to be used.
If omitted `autorestic` will search for for a `.autorestic.yml` in the current directory and your home directory.
```bash
autorestic -c /path/to/my/config.yml
```
## `--ci`
> Available since version 0.22
Run the CLI in CI Mode, which means there will be no interactivity.
This can be useful when you want to run cron e.g. as all the output will be saved.
```bash
autorestic --ci
```

View File

@ -1,7 +1,7 @@
# info # Info
Displays the config file that autorestic is refering to. Displays the config file that autorestic is referring to.
Usefull when you want to quickly see what locations are being backuped where. Useful when you want to quickly see what locations are being backed-up where.
**Pro tip:** if it gets a bit long you can read it more easily with `autorestic info | less` 😉 **Pro tip:** if it gets a bit long you can read it more easily with `autorestic info | less` 😉

View File

@ -1,19 +1,21 @@
# 🐣 Examples # 🐣 Examples
## List all the snapshots for all the backends ## Exec
### List all the snapshots for all the backends
```bash ```bash
autorestic -a exec snapshots autorestic exec -a -- snapshots
``` ```
## Unlock a locked repository ### Unlock a locked repository
If you accidentally cancelled a running operation this could be useful. If you accidentally cancelled a running operation this could be useful.
Only do this if you know what you are doing. Only do this if you know what you are doing.
```bash ```bash
autorestic -b my-backend exec unlock autorestic exec -b my-backend -- unlock
``` ```
> :ToCPrevNext > :ToCPrevNext

View File

@ -39,9 +39,11 @@ Then paste this at the bottom of the file and save it. Note that in this specifi
PATH="/usr/local/bin:/usr/bin:/bin" PATH="/usr/local/bin:/usr/bin:/bin"
# Example running every 5 minutes # Example running every 5 minutes
*/5 * * * * autorestic -c /srv/.autorestic.yml cron */5 * * * * autorestic -c /srv/.autorestic.yml --ci cron
``` ```
Now you can add as many `cron` attributes as you wish ⏱ > The `--ci` option is not required, but recommended
Now you can add as many `cron` attributes as you wish in the config file ⏱
> :ToCPrevNext > :ToCPrevNext