wal-g/templates/backup-permanent.sh.j2

13 lines
399 B
Plaintext
Raw Normal View History

2023-02-07 23:18:19 +00:00
exec 200>/tmp/backup.lock
flock -x 200
role=$(curl -k -s http://127.0.0.1:8008 || curl -k -s https://127.0.0.1:8008 | jq '.role')
if [ "${role}" == "\"master\"" ] ; then
2023-02-20 09:44:18 +00:00
{{ wal_g_pg_binary_name }} --config {{ wal_g_pg_home_dir }}/{{ wal_g_config_name }} backup-push {{ wal_g_pg_data_dir }} --full --permanent 2>&1 | tee -a /var/log/postgresql/backup-permanent.log
2023-02-07 23:18:19 +00:00
else
echo ""
fi
exec 200>&-