3 basebackup=test-2021-09-11
7 chown postgres:postgres $restore
10 tar xvf /tmp/test-2021-09-11/base.tar.gz -C $restore/
11 tar xvf /tmp/test-2021-09-11/pg_wal.tar.gz -C $restore/pg_wal/
13 cp /var/lib/pgsql/10/recovery.conf $restore/
14 vi $restore/recovery.conf
17 cat postgresql.conf | grep -v archive_mode | grep -v archive_command > postgresql.conf.new && mv postgresql.conf.new postgresql.conf
19 su postgres -c '/usr/pgsql-10/bin/pg_ctl -D '$restore' start -o "-p 5433"'
21 cat > $restore.destroy << __SHELL__
22 su postgres -c '/usr/pgsql-10/bin/pg_ctl -D $restore stop'
27 psql -U postgres -p 5433
29 su postgres -c '/usr/pgsql-10/bin/pg_ctl -D '$restore' stop'