[IMP]Odoo backup image can now be used for 1 or many hosts
This commit is contained in:
parent
f6a1a9e5c7
commit
cb91dda76a
@ -1,3 +1 @@
|
|||||||
#!/bin/bash
|
python backup.py -oh ${HOST} -pw ${ADMIN_PASSWORD} -D backups/ -n ${DATABASES}
|
||||||
|
|
||||||
python backup.py -oh ${ODOO_HOST} -pw ${ODOO_ADMIN_PASSWORD} -D backups/ -n ${ODOO_DATABASES}
|
|
||||||
|
@ -1,5 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
envsubst < /home/odoo/backup.template > /home/odoo/backup.sh
|
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
|
chown odoo:odoo /home/odoo/backup.sh
|
||||||
crontab ./crontab && touch /var/log/cron.log && cron && tail -f /var/log/cron.log
|
crontab ./crontab && touch /var/log/cron.log && cron && tail -f /var/log/cron.log
|
||||||
|
Loading…
Reference in New Issue
Block a user