From 146ac5967b90dabfaf90850656b3ae2eaad83dfa Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Tue, 21 Nov 2017 10:12:11 +0100 Subject: [PATCH] [FIX]Odoobackup overlayFS problem with tail --- backups/rsyncvolumes/Dockerfile | 1 - backups/rsyncvolumes/crontab | 5 ++--- backups/rsyncvolumes/launch.sh | 2 +- odoo/backups/Dockerfile | 3 +-- odoo/backups/crontab | 5 ++--- odoo/backups/launch.sh | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/backups/rsyncvolumes/Dockerfile b/backups/rsyncvolumes/Dockerfile index 52747bf..7c6198f 100644 --- a/backups/rsyncvolumes/Dockerfile +++ b/backups/rsyncvolumes/Dockerfile @@ -9,7 +9,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ COPY crontab /etc/crontab RUN chmod 644 /etc/crontab -RUN touch /var/log/cron.log WORKDIR /opt/backup COPY rsync.template . diff --git a/backups/rsyncvolumes/crontab b/backups/rsyncvolumes/crontab index bd6c0bd..71306ea 100644 --- a/backups/rsyncvolumes/crontab +++ b/backups/rsyncvolumes/crontab @@ -1,6 +1,5 @@ # hourly backup # m h dom mon dow user command -15 * * * * root /bin/bash /opt/backup/rsync.sh >> /var/log/cron.log 2>&1 -0 3 * * * root /usr/bin/python /opt/backup/plan.py >> /var/log/cron.log 2>&1 +15 * * * * root /bin/bash /opt/backup/rsync.sh > /proc/1/fd/1 2>/proc/1/fd/2 +0 3 * * * root /usr/bin/python /opt/backup/plan.py > /proc/1/fd/1 2>/proc/1/fd/2 # empty line needed - diff --git a/backups/rsyncvolumes/launch.sh b/backups/rsyncvolumes/launch.sh index a598515..7c4b5c7 100644 --- a/backups/rsyncvolumes/launch.sh +++ b/backups/rsyncvolumes/launch.sh @@ -2,4 +2,4 @@ envsubst < /opt/backup/rsync.template > /opt/backup/rsync.sh envsubst < /opt/backup/plan.tpl.py > /opt/backup/plan.py -cron && tail -f /var/log/cron.log +cron -f diff --git a/odoo/backups/Dockerfile b/odoo/backups/Dockerfile index ca4cedc..87dd09d 100644 --- a/odoo/backups/Dockerfile +++ b/odoo/backups/Dockerfile @@ -12,13 +12,12 @@ RUN apt-get install -y --no-install-recommends cron gettext-base COPY crontab /etc/crontab RUN chmod 644 /etc/crontab -RUN touch /var/log/cron.log COPY backup.template . COPY plan.py . COPY launch.sh . -RUN chown -R odoo:odoo . && chown odoo:odoo /var/log/cron.log +RUN chown -R odoo:odoo . VOLUME /home/odoo/backups CMD bash launch.sh diff --git a/odoo/backups/crontab b/odoo/backups/crontab index 7b0c140..1880c5d 100644 --- a/odoo/backups/crontab +++ b/odoo/backups/crontab @@ -1,6 +1,5 @@ # daily odoo backup # m h dom mon dow user command -0 2 * * * odoo /bin/bash /home/odoo/backup.sh >> /var/log/cron.log 2>&1 -10 2 * * * odoo /usr/bin/python /home/odoo/plan.py >> /var/log/cron.log 2>&1 +0 2 * * * odoo /bin/bash /home/odoo/backup.sh > /proc/1/fd/1 2>/proc/1/fd/2 +10 2 * * * odoo /usr/bin/python /home/odoo/plan.py > /proc/1/fd/1 2>/proc/1/fd/2 # empty line required at the end of this file for a valid cron file. - diff --git a/odoo/backups/launch.sh b/odoo/backups/launch.sh index cfc0505..558e464 100644 --- a/odoo/backups/launch.sh +++ b/odoo/backups/launch.sh @@ -2,4 +2,4 @@ envsubst < /home/odoo/backup.template > /home/odoo/backup.sh chown odoo:odoo /home/odoo/backup.sh -cron && tail -f /var/log/cron.log +cron -f