diff --git a/backups/rsyncvolumes/Dockerfile b/backups/rsyncvolumes/Dockerfile index 7c6198f..52747bf 100644 --- a/backups/rsyncvolumes/Dockerfile +++ b/backups/rsyncvolumes/Dockerfile @@ -9,6 +9,7 @@ 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 38a9a71..8e858fb 100644 --- a/backups/rsyncvolumes/crontab +++ b/backups/rsyncvolumes/crontab @@ -1,4 +1,6 @@ # hourly backup # m h dom mon dow user command -0 * * * * root /bin/bash /opt/backup/rsync.sh -0 1 * * * root /bin/python /opt/backup/plan.py +15 * * * * root /bin/bash /opt/backup/rsync.sh >> /var/log/cron.log 2>&1 +* 3 * * * root /usr/bin/python /opt/backup/plan.py >> /var/log/cron.log 2>&1 +# empty line needed + diff --git a/backups/rsyncvolumes/launch.sh b/backups/rsyncvolumes/launch.sh index 7c4b5c7..a598515 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 -f +cron && tail -f /var/log/cron.log diff --git a/odoo/backups/Dockerfile b/odoo/backups/Dockerfile index 93dcc18..0f65d55 100644 --- a/odoo/backups/Dockerfile +++ b/odoo/backups/Dockerfile @@ -3,14 +3,21 @@ MAINTAINER Yaltik - Fabien Bourgeois ENV ODOO_ADMIN_PASSWORD admin ENV ODOO_DATABASES demo + WORKDIR /home/odoo USER root + RUN mkdir backups 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 launch.sh . -RUN chown -R odoo:odoo . + +RUN chown -R odoo:odoo . && chown odoo:odoo /var/log/cron.log VOLUME /home/odoo/backups + CMD bash launch.sh diff --git a/odoo/backups/crontab b/odoo/backups/crontab index c1a78f4..335b429 100644 --- a/odoo/backups/crontab +++ b/odoo/backups/crontab @@ -1,3 +1,5 @@ # daily odoo backup # m h dom mon dow user command -0 0 * * * odoo /bin/bash /opt/odoo/backup.sh +* 2 * * * odoo /bin/bash /home/odoo/backup.sh >> /var/log/cron.log 2>&1 +# 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 558e464..cfc0505 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 -f +cron && tail -f /var/log/cron.log