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-07-23 10:17:33 +02:00
|
|
|
IFS=':' read -ra ODOO_FMT <<< "$ODOO_FMT"
|
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-07-23 10:17:33 +02:00
|
|
|
FMT=${ODOO_FMT[$index]:='zip'}
|
2018-07-12 18:42:30 +02:00
|
|
|
export HOST ADMIN_PASSWORD DATABASES FMT
|
2018-02-17 16:21:05 +01:00
|
|
|
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
|