2016-10-05 08:56:58 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-02-17 16:21:05 +01:00
|
|
|
set -f
|
|
|
|
echo '#!/bin/bash' > /home/odoo/backup.sh
|
|
|
|
index=0
|
2018-02-17 17:55:41 +01:00
|
|
|
IFS=':' read -ra ODOO_HOST <<< "$ODOO_HOST"
|
|
|
|
IFS=':' read -ra ODOO_ADMIN_PASSWORD <<< "$ODOO_ADMIN_PASSWORD"
|
|
|
|
IFS=':' read -ra ODOO_DATABASES <<< "$ODOO_DATABASES"
|
2018-02-17 16:21:05 +01:00
|
|
|
for host in "${ODOO_HOST[@]}"
|
|
|
|
do
|
|
|
|
HOST=${host}
|
|
|
|
ADMIN_PASSWORD=${ODOO_ADMIN_PASSWORD[$index]}
|
2018-02-17 17:55:41 +01:00
|
|
|
DATABASES=${ODOO_DATABASES[$index]}
|
2018-02-17 16:21:05 +01:00
|
|
|
export HOST ADMIN_PASSWORD DATABASES
|
|
|
|
envsubst < /home/odoo/backup.template >> /home/odoo/backup.sh
|
|
|
|
((index++))
|
|
|
|
done
|
2016-10-05 08:56:58 +02:00
|
|
|
chown odoo:odoo /home/odoo/backup.sh
|
2017-11-23 05:55:20 +01:00
|
|
|
crontab ./crontab && touch /var/log/cron.log && cron && tail -f /var/log/cron.log
|