Skip to content
Extraits de code Groupes Projets
Valider da407445 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

Fix errors on backup check with old increments

parent 0b432551
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -11,12 +11,13 @@ do
CONTAINER=$(grep "Container:" $file | cut -d ":" -f 2 | tr -d " ")
BYTES=$(grep "Bytes:" $file | cut -d ":" -f 2 | tr -d " ")
OBJECTS=$(grep "Objects:" $file | cut -d ":" -f 2 | tr -d " ")
LAST_FILE=$(tail -2 $file | grep gpg)
if [ `date -d "${LAST_FILE:5:19}" +%s` -gt `date -d '1 day ago' +%s` ]
LAST_FULL_BACKUP=$(grep full-signature $file | tail -1)
LAST_INC_BACKUP=$(grep new-signature $file | tail -1)
if [ `date -d "${LAST_FULL_BACKUP:5:19}" +%s` -gt `date -d '1 day ago' +%s` ] || [ `date -d "${LAST_INC_BACKUP:5:19}" +%s` -gt `date -d '1 day ago' +%s` ]
then
OUTPUT+="OK: Container: $CONTAINER, Size: $BYTES, # Files: $OBJECTS, Last-Modified: ${LAST_FILE:5:19}\n"
OUTPUT+="OK: Container: $CONTAINER, Size: $BYTES, # Files: $OBJECTS, Last-Full-Backup: ${LAST_FULL_BACKUP:5:19}, Last-Incremental-Backup: ${LAST_INC_BACKUP:5:19}\n"
else
OUTPUT+="NOK: Container: $CONTAINER, Size: $BYTES, # Files: $OBJECTS, Last-Modified: ${LAST_FILE:5:19}\n"
OUTPUT+="NOK: Container: $CONTAINER, Size: $BYTES, # Files: $OBJECTS, Last-Full-Backup: ${LAST_FULL_BACKUP:5:19}, Last-Incremental-Backup: ${LAST_INC_BACKUP:5:19}\n"
RETURN_CODE="2"
fi
PERF_DATA+="${CONTAINER}_size=$BYTES ${CONTAINER}_files=$OBJECTS "
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter