[ADD]Odoo backups : add optional healthchecks URL

This commit is contained in:
Fabien BOURGEOIS 2021-05-13 12:25:35 +02:00
parent 5e3437cc6e
commit 1c41f871a0
5 changed files with 11 additions and 2 deletions

View File

@ -8,7 +8,7 @@ WORKDIR /home/odoo
USER root
RUN mkdir backups
RUN apt-get install -y --no-install-recommends cron gettext-base
RUN apt-get install -y --no-install-recommends cron gettext-base curl
# Avoid overlayfs bug with tail
VOLUME /var/log
@ -16,6 +16,7 @@ VOLUME /var/log
COPY crontab ./crontab
COPY backup.template .
COPY hc.template .
COPY plan.py .
COPY launch.sh .

View File

@ -8,7 +8,7 @@ WORKDIR /home/odoo
USER root
RUN mkdir backups
RUN yum install -y gettext cronie
RUN yum install -y gettext cronie curl
# Avoid overlayfs bug with tail
VOLUME /var/log
@ -16,6 +16,7 @@ VOLUME /var/log
COPY crontab ./crontab
COPY backup.template .
COPY hc.template .
COPY plan.py .
COPY launch.c7.sh launch.sh

1
odoo/backups/hc.template Normal file
View File

@ -0,0 +1 @@
curl -m 10 --retry 5 ${HC_URL}

View File

@ -19,5 +19,8 @@ do
envsubst < /home/odoo/backup.template >> /home/odoo/backup.sh
((index++))
done
if ! [ -z ${HC_URL} ]; then
envsubst < /home/odoo/hc.template >> /home/odoo/backup.sh
fi
chown odoo:odoo /home/odoo/backup.sh
crontab ./crontab && touch /var/log/cron.log && crond && tail -f /var/log/cron.log

View File

@ -19,5 +19,8 @@ do
envsubst < /home/odoo/backup.template >> /home/odoo/backup.sh
((index++))
done
if ! [ -z ${HC_URL} ]; then
envsubst < /home/odoo/hc.template >> /home/odoo/backup.sh
fi
chown odoo:odoo /home/odoo/backup.sh
crontab ./crontab && touch /var/log/cron.log && cron && tail -f /var/log/cron.log