I need to backup the current db while logged into odoo. I should be able to do it using a button, so that suppose I click on the button, it works the same way as odoo defaul
You can use the CURL to download the full backup (assets + DB), this method is comparatively faster than pg_dump.
curl -X POST \
-F "master_pwd=${ADMIN_PASSWORD}" \
-F "name=${ODOO_DATABASE}" \
-F "backup_format=zip" \
-o ${BACKUP_DIR}/${ODOO_DATABASE}.$(date +%F-%T).zip \
${HOST}/web/database/backup
You can wrap inside a custom (your own) Odoo add-on if you wish to. Hope this helps.