diff --git a/README.md b/README.md index deeaa23..408b8fe 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ sudo curl -Lo /usr/local/sbin/bw-updater -sSf https://gitea.illuad.fr/adrien/bw- sudo chmod 750 /usr/local/sbin/bw-updater ``` +Create the logs' directory. + +``` +sudo mkdir -p /var/log/updater/bitwarden +``` + ## Configuration This script requires the configuration of 3 variables to work: `key`, `chat_id` and `username`. diff --git a/bw-updater b/bw-updater index 351e6c2..bf5c4ad 100644 --- a/bw-updater +++ b/bw-updater @@ -1,5 +1,11 @@ #! /usr/bin/env bash +# all executed commands are printed to stdout +set -x + +# redirect stdout (and stderr to stdout) to a file +exec 1> /var/log/updater/bitwarden/bitwarden-$(date +%F).log 2>&1 + # abort on nonzero exitstatus set -o errexit