-
Hahn Axel (hahn) authoredHahn Axel (hahn) authored
check_backup_one 1.25 KiB
#!/bin/bash
# ======================================================================
#
# WORK IN PROGRESS
#
# Check ONE BACKUP connection count
#
# requirements access to storage_helper.sh
# ls -ld /opt/imlbackup/server/
# drwxr-x--- 3 imlbackup imlbackup 4096 Jul 27 06:25 /opt/imlbackup/server/
#
# ----------------------------------------------------------------------
# 2020-07-27 v0.x <axel.hahn@iml.unibe.ch>
# ======================================================================
. `dirname $0`/inc_pluginfunctions
myscript=/opt/imlbackup/server/storage_helper.sh
# ----------------------------------------------------------------------
# MAIN
# ----------------------------------------------------------------------
if [ ! -x $myscript ]; then
ph.abort "UNKNOWN: $myscript is not available / executable."
fi
# --- read data
tmpfile=$( mktemp )
$myscript status > $tmpfile
typeset -i iRunning=`cat $tmpfile | grep "STATUS" | cut -f 2 -d " "`
typeset -i iMax=` cat $tmpfile | grep "STATUS" | cut -f 8 -d " " | tr -d '.'`
# --- status output
ph.status "Backups running: $iRunning (max $iMax)"
cat $tmpfile
rm -f $tmpfile
ph.perfadd "running" "${iRunning}" "" "" 0 $iMax
ph.exit
# ----------------------------------------------------------------------