Revision 13287
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/lib/sh/db.sh | ||
---|---|---|
426 | 426 |
sudo service postgresql "$@" |
427 | 427 |
} |
428 | 428 |
|
429 |
pg_start_backup() # requires config `wal_level = archive|hot_standby` |
|
430 |
{ echo_func; as_root=1 psql <<<"SELECT pg_start_backup('backup', true);"; } |
|
431 |
|
|
432 |
pg_stop_backup() # requires pg_start_backup() to have run |
|
433 |
{ echo_func; as_root=1 psql <<<"SELECT pg_stop_backup();"; } |
|
434 |
|
|
429 | 435 |
pg_snapshot() # usage: [live=] [from=...] [to=...] pg_snapshot rsync_opts... |
430 | 436 |
{ |
431 | 437 |
echo_func; kw_params from to; local from="${from:-/var/lib/postgresql}" |
Also available in: Unified diff
lib/sh/db.sh: added pg_start_backup(), pg_stop_backup()