This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5885507
commit a8f6b01
Showing
2 changed files
with
34 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
### Debug locally | ||
|
||
Here are some useful debug commands when developing locally: | ||
|
||
``` | ||
mkdir test | ||
mkdir test/data | ||
mkdir test/pgbackrest | ||
sudo chown -R 999:999 test | ||
sudo docker build . -t pgbr && sudo docker run -e PG_BACKREST_REPO_LOCAL_ENABLED=true -e POSTGRES_PASSWORD=mysecretpassword -p 5435:5432 -v ./test/data:/var/lib/postgresql/data -v ./test/pgbackrest:/var/lib/pgbackrest pgbr | ||
``` | ||
``` | ||
sudo rm -rf test && mkdir test && mkdir test/data && mkdir test/pgbackrest && sudo chown -R 999:999 test | ||
``` | ||
|
||
``` | ||
sudo docker build . -t pgbr && sudo docker run -e PG_BACKREST_REPO_LOCAL_ENABLED=true -e POSTGRES_PASSWORD=mysecretpassword -e RESTORE_ENABLED=true -e RESTORE_TIMESTAMP="2024-10-06 17:33:27" -p 5435:5432 -v ./test/data:/var/lib/postgresql/data -v ./test/pgbackrest:/var/lib/pgbackrest pgbr | ||
``` | ||
|
||
``` | ||
create table users_test ( | ||
user_id varchar(50), | ||
date timestamp NOT NULL DEFAULT NOW() | ||
); | ||
``` | ||
|
||
``` | ||
insert into users_test (user_id) values (1); | ||
``` | ||
|
||
``` | ||
pgbackrest --stanza=my-pg-pgbackrest-stanza --type=time --target="2024-10-05 12:53:55" restore | ||
``` |