Parametrise borgbackup exporter.
This commit is contained in:
parent
973b9b26b4
commit
0175a771b9
2 changed files with 18 additions and 9 deletions
|
@ -14,8 +14,19 @@ virtualenv venv
|
|||
. venv/bin/activate
|
||||
pip install prometheus_client
|
||||
pip install dateutils
|
||||
|
||||
# Start service
|
||||
service prometheus-borgbackup-exporter --ifstarted restart
|
||||
service prometheus-borgbackup-exporter --ifstopped start
|
||||
EOF
|
||||
|
||||
# Start service: `service` does not support the same options on different OSes
|
||||
os=$(cat "${__global:?}/explorer/os")
|
||||
|
||||
case "$os" in
|
||||
ubuntu)
|
||||
echo "systemctl restart prometheus-borgbackup-exporter"
|
||||
;;
|
||||
alpine)
|
||||
cat <<- EOF
|
||||
service prometheus-borgbackup-exporter --ifstarted restart
|
||||
service prometheus-borgbackup-exporter --ifstopped start
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
os=$(cat "${__global:?}/explorer/os")
|
||||
|
||||
mkdir -p "${__object:?}/files"
|
||||
REPOS_DIR=$(cat "${__object:?}/parameter/repos-dir")
|
||||
export REPOS_DIR
|
||||
|
||||
case "$os" in
|
||||
debian|ubuntu)
|
||||
__package python3-virtualenv
|
||||
|
@ -32,9 +35,4 @@ case "$os" in
|
|||
;;
|
||||
esac
|
||||
|
||||
REPOS_DIR=$(cat "${__object:?}/parameter/repos-dir")
|
||||
export REPOS_DIR
|
||||
__directory /opt/prometheus-borgbackup-exporter
|
||||
|
||||
# Make sure the borgbackup user exist.
|
||||
__user borgbackup --home "$REPOS_DIR" --create-home
|
||||
|
|
Reference in a new issue