Skip to content

Commit 20cfee1

Browse files
committed
add run_interval feature documentation and examples
1 parent d58fa43 commit 20cfee1

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ docker run \
150150
homeylab/bookstack-file-exporter:latest
151151
```
152152

153+
#### Docker Compose
154+
When using the configuration option: `run_interval`, a docker compose set up could be used to run the exporter as an always running application. The exporter will sleep and wait until `{run_interval}` seconds has elapsed before subsequent runs.
155+
156+
An example is shown in `examples/docker-compose.yaml`
157+
153158
#### Environment Variables
154159
See [Valid Environment Variables](#valid-environment-variables) for more options.
155160

@@ -256,6 +261,7 @@ More descriptions can be found for each section below:
256261
| `assets.export_meta` | `bool` | `false` | Optional (default: `false`), export of metadata about the page in a json file |
257262
| `assets.verify_ssl` | `bool` | `false` | Optional (default: `true`), whether or not to check ssl certificates when requesting content from Bookstack host |
258263
| `keep_last` | `int` | `false` | Optional (default: `None`), if exporter can delete older archives. valid values are:<br>- set to `-1` if you want to delete all archives after each run (useful if you only want to upload to object storage)<br>- set to `1+` if you want to retain a certain number of archives<br>- `0` will result in no action done |
264+
| `run_interval` | `int` | `false` | Optional (default: `0`). If specified, exporter will run in a loop and pause for `{run_interval}` seconds before subsequent runs. Example: `86400` seconds = `24` hours or run once a day. Setting this property to `0` will disable looping |
259265
| `minio` | `object` | `false` | Optional [Minio](#minio-backups) configuration options. |
260266

261267
#### Valid Environment Variables

bookstack_file_exporter/config_helper/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ class UserInput(BaseModel):
3939
assets: Optional[Assets] = Assets()
4040
minio: Optional[ObjectStorageConfig] = None
4141
keep_last: Optional[int] = None
42-
run_interval: Optional[int] = None
42+
run_interval: Optional[int] = 0

examples/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,8 @@ output_path: "bkps/"
5252
# set to 1+ if you want to retain a certain number of archives
5353
# set to 0 or comment out section if you want no action done
5454
keep_last: 5
55+
## optional - if specified exporter will run in a loop
56+
# it will run and then pause for {run_interval} seconds before running again
57+
# specify in seconds, example: 86400 seconds = 24 hours or run once a day
58+
# omit/commit out or set to 0 if you just want a single run and exit
59+
run_interval: 0

examples/minio_config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,9 @@ clean_up: true
8282
# - this is useful if you only want to upload to object storage
8383
# set to 1+ if you want to retain a certain number of archives
8484
# set to 0 or comment out section if you want no action done
85-
keep_last: -1
85+
keep_last: -1
86+
## optional - if specified exporter will run in a loop
87+
# it will run and then pause for {run_interval} seconds before running again
88+
# specify in seconds, example: 86400 seconds = 24 hours or run once a day
89+
# omit/commit out or set to 0 if you just want a single run and exit
90+
run_interval: 0

0 commit comments

Comments
 (0)