Skip to content
Extraits de code Groupes Projets
Valider f2c712f4 rédigé par root's avatar root
Parcourir les fichiers

Add Check Cloud Storage

parent 556b0412
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#!/bin/bash
# Copyright © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
OUTPUT=""
RETURN_CODE="0"
for file in `ls /mnt/vdb/backup/cloud/*.latest`
do
INIT_LINE=$(grep -A 2 "Container:" $file | grep -v ACL | grep -v Sync | grep -v X- | grep -v Accept-Ranges | tr -d '\t ' | tr '\n' ' ')
LAST_FILE=$(tail -2 $file | grep gpg)
if [ `date -d "${LAST_FILE:5:19}" +%s` -gt `date -d '7 days ago' +%s` ]
then
OUTPUT+="OK : $INIT_LINE Last-Modified:${LAST_FILE:5:19}\n"
else
OUTPUT+="NOK : $INIT_LINE Last-Modified:${LAST_FILE:5:19}\n"
RETURN_CODE="2"
fi
done
echo $OUTPUT
exit ${RETURN_CODE}
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