#!/bin/bash set -f echo '#!/bin/bash' > /home/odoo/backup.sh index=0 ODOO_HOST=(${ODOO_HOST//:/ }) ODOO_ADMIN_PASSWORD=(${ODOO_ADMIN_PASSWORD//:/ }) ODOO_DATABASES=(${ODOO_DATABASES//:/ }) for host in "${ODOO_HOST[@]}" do HOST=${host} ADMIN_PASSWORD=${ODOO_ADMIN_PASSWORD[$index]} DATABASE=${ODOO_DATABASES[$index]} export HOST ADMIN_PASSWORD DATABASES envsubst < /home/odoo/backup.template >> /home/odoo/backup.sh ((index++)) done chown odoo:odoo /home/odoo/backup.sh crontab ./crontab && touch /var/log/cron.log && cron && tail -f /var/log/cron.log