Skip to content
Snippets Groups Projects
Commit 93eee3f2 authored by Rémi - Le Filament's avatar Rémi - Le Filament
Browse files

Update check Odoo scripts

parent 1d120074
No related branches found
No related tags found
No related merge requests found
...@@ -9,11 +9,14 @@ RETURN_CODE="0" ...@@ -9,11 +9,14 @@ RETURN_CODE="0"
for file in `ls /backup/odoo2/*.latest` for file in `ls /backup/odoo2/*.latest`
do do
CONTAINER=$(grep "Container:" $file | cut -d ":" -f 2 | tr -d " ") CONTAINER=$(grep "Container:" $file | cut -d ":" -f 2 | tr -d " ")
if [[ "$CONTAINER" == 'tuleap_filament_dedicated2' ]] ; then
continue
fi
BYTES=$(grep "Bytes:" $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 " ") OBJECTS=$(grep "Objects:" $file | cut -d ":" -f 2 | tr -d " ")
LAST_FULL_BACKUP=$(grep full-signature $file | tail -1) LAST_FULL_BACKUP=$(grep full-signature $file | tail -1)
LAST_INC_BACKUP=$(grep new-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` ] if ([ -n "$LAST_FULL_BACKUP" ] && [ `date -d "${LAST_FULL_BACKUP:5:19}" +%s` -gt `date -d '1 day ago' +%s` ]) || ([ -n "$LAST_INC_BACKUP" ] && [ `date -d "${LAST_INC_BACKUP:5:19}" +%s` -gt `date -d '1 day ago' +%s` ])
then then
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" 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 else
......
...@@ -9,11 +9,14 @@ RETURN_CODE="0" ...@@ -9,11 +9,14 @@ RETURN_CODE="0"
for file in `ls /backup/odoo/*.latest` for file in `ls /backup/odoo/*.latest`
do do
CONTAINER=$(grep "Container:" $file | cut -d ":" -f 2 | tr -d " ") CONTAINER=$(grep "Container:" $file | cut -d ":" -f 2 | tr -d " ")
if [[ "$CONTAINER" == 'odoo_oikos' ]] || [[ "$CONTAINER" == 'tuleap_filament_dedicated2' ]] ; then
continue
fi
BYTES=$(grep "Bytes:" $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 " ") OBJECTS=$(grep "Objects:" $file | cut -d ":" -f 2 | tr -d " ")
LAST_FULL_BACKUP=$(grep full-signature $file | tail -1) LAST_FULL_BACKUP=$(grep full-signature $file | tail -1)
LAST_INC_BACKUP=$(grep new-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` ] if ([ -n "$LAST_FULL_BACKUP" ] && [ `date -d "${LAST_FULL_BACKUP:5:19}" +%s` -gt `date -d '1 day ago' +%s` ]) || ([ -n "$LAST_INC_BACKUP" ] && [ `date -d "${LAST_INC_BACKUP:5:19}" +%s` -gt `date -d '1 day ago' +%s` ])
then then
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" 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 else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment