mirror of
https://gitea.0xace.cc/ansible-galaxy/wal-g.git
synced 2024-11-25 07:57:25 +00:00
13 lines
362 B
Plaintext
13 lines
362 B
Plaintext
|
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
|
||
|
{{ wal_g_pg_binary_name }} backup-push {{ wal_g_pg_home_dir }}/{{ wal_g_postgresql_major_version }}/data --full 2>&1 | tee -a /var/log/postgresql/backup.log
|
||
|
else
|
||
|
echo ""
|
||
|
fi
|
||
|
|
||
|
exec 200>&-
|