add new seperateor and add wget

This commit is contained in:
2022-11-26 12:09:30 +01:00
parent 5908be219a
commit 5b30848e82
4 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ COPY prometheus-borg-exporter/borg_exporter.rc /etc/
# Install packages # Install packages
RUN apk update ; apk upgrade RUN apk update ; apk upgrade
RUN apk add --no-cache sudo bash bash-completion tzdata openssh openrc neofetch \ RUN apk add --no-cache sudo bash bash-completion tzdata openssh openrc neofetch \
borgbackup dateutils prometheus-node-exporter curl borgbackup dateutils prometheus-node-exporter curl wget
RUN rm -rf /var/cache/apk/* RUN rm -rf /var/cache/apk/*
# Setup SSH-Server # Setup SSH-Server
+1
View File
@@ -15,6 +15,7 @@ export PS1="\[\e[31m\][\[\e[m\]\[\e[38;5;172m\]\u\[\e[m\]@\[\e[38;5;153m\]\h\[\e
# Borg Repo finder # Borg Repo finder
############################################################################################################################## ##############################################################################################################################
source "/variables.sh" source "/variables.sh"
COLUMNS=$(/usr/bin/tput cols)
function find_borg_repo { function find_borg_repo {
repo_list=( $(find "$1" -name "index.*" -type f | rev | cut -d '/' -f "2-" | rev) ) repo_list=( $(find "$1" -name "index.*" -type f | rev | cut -d '/' -f "2-" | rev) )
+12 -1
View File
@@ -2,9 +2,20 @@ DOCKER_IMAGE_VERSION="2.0.0"
BORG_VERSION=$(borg -V) BORG_VERSION=$(borg -V)
SSH_FOLDERS=( "/sshkeys/clients" "/sshkeys/host" ) SSH_FOLDERS=( "/sshkeys/clients" "/sshkeys/host" )
NODE_EXPORTER_DIR="/logs" NODE_EXPORTER_DIR="/logs"
COLUMNS="86"
############################################################################################################################## ##############################################################################################################################
# Funktionen # Funktionen
############################################################################################################################## ##############################################################################################################################
function sepurator { function sepurator {
echo "======================================================================================" if [ ! -z "$2" ]; then
local end="$2"
else
local end="$COLUMNS"
fi
local start=1
local str="${1:-=}"
local range=$(seq $start $end)
for i in $range ; do echo -n "${str}"; done
echo;
} }
@@ -205,6 +205,13 @@ function cleanup() {
writeDefinitionsToMetrics writeDefinitionsToMetrics
if [ -n "${REPOSITORY}" ]; then if [ -n "${REPOSITORY}" ]; then
getBorgDataForRepository "${REPOSITORY}" "${HOSTNAME}" getBorgDataForRepository "${REPOSITORY}" "${HOSTNAME}"
if [ ! -z "${READ_BASEREPODIR}" ]; then
if [ -d "${BASEREPODIR}" ]; then
findRepositorysAndGetData
else
echo "Error: Set BASEREPODIR in /etc/borg_exporter.rc"
fi
fi
else else
#discover (recursively) borg repositories starting from a path and extract info for each #discover (recursively) borg repositories starting from a path and extract info for each
#(e.g. when running on the backup server directly) #(e.g. when running on the backup server directly)