-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce ENABLE_JSON_LOGGING
#216
base: master
Are you sure you want to change the base?
Conversation
This change adds the `ENABLE_JSON_LOGGING` option to export restic metadata in JSON format. The goal is to improve accessibility by allowing users to utilize tools like `jq` to process the metadata. This enables users to create external scripts for extracting metadata and sending notifications using `run_commands`. update doc and include notify script as sample to send backup metadata via apprise Export `LOG_FILE` and create docker-compose for contributing - export `LOG_FILE` so it will be available for subprocess executed via `run_commands` - Add docker-compose.contribute.yml facilitate contributing process - make `notify` executable and copy it to /usr/local/bin - notify: update content to only include summary and errors for now. jq was complaining on payload too large when using verbose mode. - update doc
Hi @jeankhawand please any idea why it is still not deployed ? |
@djmaze that's will also make it easy to restore snapshots in the futur |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply.. This looks good to me! But will need a test, see below.
@@ -99,7 +99,10 @@ _Note: `BACKUP_CRON`, `PRUNE_CRON` and `CHECK_CRON` are mutually exclusive._ | |||
- `TZ` - Optional. Set your timezone for the correct cron execution time. | |||
- `SKIP_INIT` - Skip initialization of the restic repository, even if it can not be accessed. | |||
- `SKIP_INIT_CHECK`- Do not fail, if initialization of the restic repository fails for whatever reason. | |||
|
|||
- `ENABLE_JSON_LOGGING` = Converts Restic's standard output to JSON format. This allows users to leverage tools like `jq` to extract specific fields from the metadata. Additionally, it supports calling external scripts for further processing, such as [executing commands after a backup](#execute-commands-after-backup). For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should also document that the LOG_FILE
env variable is set for the commands to be used.
@@ -0,0 +1,72 @@ | |||
version: "3.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why you added this file and what the name is exactly about? IMO we can just remove this.
@@ -0,0 +1,83 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functionality should also be tested. I will add a test.
This change adds the
ENABLE_JSON_LOGGING
option to export restic metadata in JSON format. The goal is to improve accessibility by allowing users to utilize tools likejq
to process the metadata. This enables users to create external scripts for extracting metadata and sending notifications usingrun_commands
.update doc and include notify script as sample to send backup metadata via apprise
Export
LOG_FILE
and create docker-compose for contributingLOG_FILE
so it will be available for subprocess executed viarun_commands
notify
executable and copy it to /usr/local/bin