Closed garry-t closed 3 months ago
@garry-t why not simplify the check for the same as for pgbackrest?
if [ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ]; then wal-g backup-push {{ postgresql_data_dir }} > {{ postgresql_log_dir }}/walg_backup.log 2>&1; fi
or
[ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ] && wal-g backup-push {{ postgresql_data_dir }} > {{ postgresql_log_dir }}/walg_backup.log 2>&1
I don't see the need for different approaches.
@garry-t why not simplify the check for the same as for pgbackrest?
if [ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ]; then wal-g backup-push {{ postgresql_data_dir }} > {{ postgresql_log_dir }}/walg_backup.log 2>&1; fi
or
[ $(psql -tAXc 'select pg_is_in_recovery()') = 'f' ] && wal-g backup-push {{ postgresql_data_dir }} > {{ postgresql_log_dir }}/walg_backup.log 2>&1
I don't see the need for different approaches.
I kept solution closer to original. Will check your suggestion.
Debian bookworm /bin/sh: 1: wal-g: not found
I think I should use the full path, like /usr/local/bin/wal-g
Feel free to suggest a PR.
Fix syntax issue inside cron file #657 Plus fix problem with wal-g run, config file now specified in command directly.
This is a simplest solution I found. Minimum changes required, but now it works