Skip to content
Snippets Groups Projects
Commit 4d12d315 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

backup-status.sh v1.5 - handle multiple backup tools

parent 3cd74416
No related branches found
No related tags found
No related merge requests found
# ignore files of a local instance
inc_config.sh
log/c*
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# 2018-02-14 v1.1 hahn configure time limit # 2018-02-14 v1.1 hahn configure time limit
# 2019-10-20 v1.3 hahn source inc_config.sh # 2019-10-20 v1.3 hahn source inc_config.sh
# 2020-12-07 v1.4 hahn deactivate backup # 2020-12-07 v1.4 hahn deactivate backup
# 2021-06-16 v1.5 hahn handle multiple backup tools
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
cd ${sBackupBasedir} || exit 1 cd ${sBackupBasedir} || exit 1
sVersion=1.4 sVersion=1.5
typeset -i iErrors=0 typeset -i iErrors=0
typeset -i iHours=36 typeset -i iHours=36
typeset -i iMinutes=$iHours*60 typeset -i iMinutes=$iHours*60
...@@ -60,7 +61,7 @@ function _getFileAge(){ ...@@ -60,7 +61,7 @@ function _getFileAge(){
function getServers(){ function getServers(){
# ls -1 | fgrep "iml.unibe.ch" # ls -1 | fgrep "iml.unibe.ch"
ls -1 | grep -Ev "^(_active|SOMETHINGELSE)" ls -1d */* | grep -Ev "/(_active|#recycle|SOMETHINGELSE)"
} }
...@@ -94,7 +95,7 @@ function _checkDir(){ ...@@ -94,7 +95,7 @@ function _checkDir(){
echo echo
else else
echo "SKIP: $mydir won't be scanned." echo "SKIP: $mydir won't be scanned. It isn't a directory."
fi fi
} }
...@@ -118,14 +119,13 @@ echo ...@@ -118,14 +119,13 @@ echo
echo "changed files last $iHours hours and used diskspace:" echo "changed files last $iHours hours and used diskspace:"
echo echo
# _checkDir . # _checkDir .
echo # echo
echo "... and by server and backup sets:" # echo "... and by server and backup sets:"
echo # echo
for myserver in `getServers` for myserver in `getServers`
do do
color head color head
echo ----- $myserver echo ----- SERVER: $myserver
color reset color reset
echo echo
if [ -f $myserver/$sInactiveFile ]; then if [ -f $myserver/$sInactiveFile ]; then
...@@ -146,9 +146,8 @@ echo ...@@ -146,9 +146,8 @@ echo
echo "INFO: keeping it $iKeepBackups d .. $iDays d left." echo "INFO: keeping it $iKeepBackups d .. $iDays d left."
fi fi
else else
echo
_checkDir $myserver _checkDir $myserver
for subdir in `ls -1 $myserver` echo $myserver | grep "restic-backup" > /dev/null || for subdir in `ls -1 $myserver`
do do
_checkDir $myserver/$subdir _checkDir $myserver/$subdir
done done
...@@ -164,7 +163,7 @@ if [ $iErrors -eq 0 ]; then ...@@ -164,7 +163,7 @@ if [ $iErrors -eq 0 ]; then
echo "OK" echo "OK"
else else
color error color error
echo "$iErrors Errors detected." echo "Found errors: $iErrors"
fi fi
color reset color reset
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment