You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-5Lines changed: 31 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,10 +90,12 @@ spec:
90
90
| S3_ENDPOINT ||| The AWS Endpoint URL, for S3 Compliant APIs such as [minio](https://minio.io)|
91
91
| S3_S3V4 | no || Set to `yes` to enable AWS Signature Version 4, required for [minio](https://minio.io) servers |
92
92
| SCHEDULE ||| Backup schedule time, see explainatons below |
93
-
| ENCRYPTION_PASSWORD ||| Password to encrypt/decrypt the backup |
93
+
| ENCRYPTION_PASSWORD ||| Password to encrypt/decrypt the backup |
94
94
| DELETE_OLDER_THAN ||| Delete old backups, see explanation and warning below |
95
-
| COMPRESSION_CMD | gzip || Command used to compress the backup (e.g. `pigz` for parallel compression) |
96
-
| DECOMPRESSION_CMD | gunzip -c || Command used to decompress the backup (e.g. `pigz -dc` for parallel decompression) |
95
+
| USE_CUSTOM_FORMAT | no || Use PostgreSQL's custom format (-Fc) instead of plain text with compression |
96
+
| COMPRESSION_CMD | gzip || Command used to compress the backup (e.g. `pigz` for parallel compression) - ignored when USE_CUSTOM_FORMAT=yes |
97
+
| DECOMPRESSION_CMD | gunzip -c || Command used to decompress the backup (e.g. `pigz -dc` for parallel decompression) - ignored when USE_CUSTOM_FORMAT=yes |
98
+
| PARALLEL_JOBS | 1 || Number of parallel jobs for pg_restore when using custom format backups |
97
99
| BACKUP_FILE || Y*| Required for restore. The path to the backup file in S3, format: S3_PREFIX/filename |
98
100
| CREATE_DATABASE | no || For restore: Set to `yes` to create the database if it doesn't exist |
99
101
| DROP_DATABASE | no || For restore: Set to `yes` to drop the database before restoring (caution: destroys existing data). Use with CREATE_DATABASE=yes to recreate it |
@@ -114,12 +116,36 @@ WARNING: this will delete all files in the S3_PREFIX path, not just those create
114
116
115
117
You can additionally set the `ENCRYPTION_PASSWORD` environment variable like `-e ENCRYPTION_PASSWORD="superstrongpassword"` to encrypt the backup. The restore process will automatically detect encrypted backups and decrypt them when the `ENCRYPTION_PASSWORD` environment variable is set correctly. It can be manually decrypted using `openssl aes-256-cbc -d -in backup.sql.gz.enc -out backup.sql.gz`.
116
118
117
-
### Compression Options
119
+
### Backup Format and Compression Options
118
120
119
-
By default, backups are compressed with `gzip` and decompressed with `gunzip -c`. For improved performance on multi-core systems, you can use `pigz` (parallel gzip) instead:
121
+
There are two options for backup format:
122
+
123
+
1.**Plain text format with compression** (default):
124
+
- Uses plain SQL text output compressed with gzip/pigz
- Supports parallel restoration for faster restores
132
+
- Allows selective table/schema restoration
133
+
- Recommended for larger databases
134
+
135
+
For plain text format, backups are compressed with `gzip` by default. For improved performance on multi-core systems, you can use `pigz` (parallel gzip) instead:
120
136
121
137
```sh
122
138
$ docker run ... -e COMPRESSION_CMD=pigz ... itbm/postgres-backup-s3
123
139
124
140
$ docker run ... -e DECOMPRESSION_CMD="pigz -dc" ... itbm/postgres-backup-s3
125
141
```
142
+
143
+
When using custom format with parallel restore:
144
+
145
+
```sh
146
+
$ docker run ... -e USE_CUSTOM_FORMAT=yes ... itbm/postgres-backup-s3
147
+
148
+
$ docker run ... -e PARALLEL_JOBS=4 -e BACKUP_FILE=backup/dbname_0000-00-00T00:00:00Z.dump ... itbm/postgres-backup-s3
149
+
```
150
+
151
+
Note: Custom format is not available when using `POSTGRES_DATABASE=all` as pg_dumpall does not support this format.
0 commit comments