summaryrefslogtreecommitdiff
path: root/lastBackups.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-10 22:36:04 +0100
committerErich Eckner <git@eckner.net>2019-02-10 22:36:04 +0100
commit314ad8d94c5ff33fd2eadb1027748550be0e7e4f (patch)
treeb94d525ac5758380cbc8cbcc8bce8e5b68823697 /lastBackups.in
parent080efe8cbf8e5bc69a17f8af8f5feffd01dd67fe (diff)
downloadhardlinkedBackups-314ad8d94c5ff33fd2eadb1027748550be0e7e4f.tar.xz
camelCase -> no-camel-case, backup-progress new
Diffstat (limited to 'lastBackups.in')
-rwxr-xr-xlastBackups.in110
1 files changed, 0 insertions, 110 deletions
diff --git a/lastBackups.in b/lastBackups.in
deleted file mode 100755
index 9f0d3e8..0000000
--- a/lastBackups.in
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/bin/bash
-
-# lastBackups version #VERSION#
-
-[ -r "#ETCDIR#/backup.conf" ] && \
- . "#ETCDIR#/backup.conf"
-
-usage () {
- >&2 echo \
-'Usage: lastBackups
-Show information about date of last backups and warn about outdated ones.
-
-Options:
-#HELPTEXT# #'
- [ -n "$1" ] && exit $1
- exit 1
-}
-
-if [ $# -eq 1 ]
-then
- if [ "$1" == "--help" ]
- then
- usage 0
- elif [ "$1" == "--version" ]
- then
- >&2 echo '#VERSION#'
- exit 0
- fi
- usage
-elif [ $# -gt 1 ]
-then
- usage
-fi
-
-unset namen
-unset veraltet
-unset daten
-
-for backupID in ${!backups[@]}
-do
- dest="${backups["${backupID}"]%% *}"
- dest="${dest%/}"
- while [ ! -d "${dest}" ] && [ ${maxWait} -gt 0 ]
- do
- sleep 1
- maxWait=$[${maxWait}-1]
- done
-
- lbu=$(
- ls -1 ${dest} | \
- grep -v "^aktuell$" | \
- sed "s/^duplicity-\(inc\|full\)\.\(.*\.\)\?\([0-9]\{4\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)T[0-9]\{6\}Z\..*$/\3_\4_\5/" | \
- sort -n | \
- uniq | \
- grep "^[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}$" | \
- tail -n1
- )
- [ "${lbu}" == "" ] && lbu="2000_01_01"
- delta=$[$(date +%s) - $(date -d $(echo ${lbu} | sed "s/_//g") +%s)]
- namen[${#namen[@]}]="$(basename $(echo ${dest} | sed "s#/\(${recognSubdirRegex}\)\$#_\1#" | sed "s#/rsync\$##; s#/duplicity\$##"))"
- if [ ! -d "${dest}/${lbu}" ]
- then
- veraltet[${#veraltet[@]}]="LEER!"
- elif [ ${delta} -gt ${outdatedLimit} ] && \
- ! printf '%s\n' "${seldomBackups[@]}" | \
- grep -qxF "${backupID}"
- then
- veraltet[${#veraltet[@]}]="VERALTET!"
- elif [ ${delta} -gt ${outdatedSeldomLimit} ]
- then
- veraltet[${#veraltet[@]}]="VERALTET!"
- else
- veraltet[${#veraltet[@]}]=""
- fi
- daten[${#daten[@]}]="${lbu}"
-done
-
-nl=0
-vl=0
-dl=0
-
-for ((i=0; i<${#namen[@]}; i++))
-{
- [ ${#namen[${i}]} -gt ${nl} ] && nl=${#namen[${i}]}
- [ ${#veraltet[${i}]} -gt ${vl} ] && vl=${#veraltet[${i}]}
- [ ${#daten[${i}]} -gt ${dl} ] && dl=${#daten[${i}]}
-}
-
-for ((i=0; i<${#namen[@]}; i++))
-{
- while [ ${#namen[${i}]} -lt ${nl} ]
- do
- namen[${i}]="${namen[${i}]} "
- done
- while [ ${#veraltet[${i}]} -lt ${vl} ]
- do
- veraltet[${i}]="${veraltet[${i}]} "
- done
- while [ ${#daten[${i}]} -lt ${dl} ]
- do
- daten[${i}]="${daten[${i}]} "
- done
-}
-
-for ((i=0; i<${#namen[@]}; i++))
-{
- echo "${daten[${i}]} ${veraltet[${i}]} ${namen[${i}]} ${daten[${i}]}"
-} | \
- sort | \
- sed "s/^\S\+\s//"