Add deployment example
This commit is contained in:
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023 Jonas Kaninda
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
18
README.md
18
README.md
@@ -21,6 +21,12 @@ Postgres Backup tool, backup database to S3 or Object Storage
|
|||||||
- local
|
- local
|
||||||
- s3
|
- s3
|
||||||
- Object storage
|
- Object storage
|
||||||
|
|
||||||
|
## Volumes:
|
||||||
|
|
||||||
|
- /s3mnt => S3 mounting path
|
||||||
|
- /backup => local storage mounting path
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
| Options | Shorts | Usage |
|
| Options | Shorts | Usage |
|
||||||
@@ -307,3 +313,15 @@ spec:
|
|||||||
value: "https://s3.us-west-2.amazonaws.com"
|
value: "https://s3.us-west-2.amazonaws.com"
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
```
|
```
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the MIT License. See the LICENSE file for details.
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
**Jonas Kaninda**
|
||||||
|
- <https://github.com/jkaninda>
|
||||||
|
|
||||||
|
## Copyright
|
||||||
|
|
||||||
|
Copyright (c) [2023] [Jonas Kaninda]
|
||||||
|
|||||||
23
example/docker-compose.local.yaml
Normal file
23
example/docker-compose.local.yaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
postgres-bkup:
|
||||||
|
image: jkaninda/pg-bkup
|
||||||
|
container_name: pg-bkup
|
||||||
|
privileged: true
|
||||||
|
devices:
|
||||||
|
- "/dev/fuse"
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- bkup --operation backup --path /mys3_custome_path --dbname database_name --mode scheduled --period "0 1 * * *"
|
||||||
|
volumes:
|
||||||
|
- ./backup:/backup
|
||||||
|
environment:
|
||||||
|
- DB_PORT=5432
|
||||||
|
- DB_HOST=postgres
|
||||||
|
- DB_USERNAME=userName
|
||||||
|
- DB_PASSWORD=${DB_PASSWORD}
|
||||||
|
- ACCESS_KEY=${ACCESS_KEY}
|
||||||
|
- SECRET_KEY=${SECRET_KEY}
|
||||||
|
- BUCKETNAME=${BUCKETNAME}
|
||||||
|
- S3_ENDPOINT=https://s3.us-west-2.amazonaws.com
|
||||||
21
example/docker-compose.yaml
Normal file
21
example/docker-compose.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
postgres-bkup:
|
||||||
|
image: jkaninda/pg-bkup
|
||||||
|
container_name: pg-bkup
|
||||||
|
privileged: true
|
||||||
|
devices:
|
||||||
|
- "/dev/fuse"
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- bkup --operation backup --storage s3 --path /mys3_custome_path --dbname database_name --mode scheduled --period "0 1 * * *"
|
||||||
|
environment:
|
||||||
|
- DB_PORT=5432
|
||||||
|
- DB_HOST=postgres
|
||||||
|
- DB_USERNAME=userName
|
||||||
|
- DB_PASSWORD=${DB_PASSWORD}
|
||||||
|
- ACCESS_KEY=${ACCESS_KEY}
|
||||||
|
- SECRET_KEY=${SECRET_KEY}
|
||||||
|
- BUCKETNAME=${BUCKETNAME}
|
||||||
|
- S3_ENDPOINT=https://s3.us-west-2.amazonaws.com
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# PosgreSQL Backup & Restore
|
||||||
|
# @author Jonas Kaninda
|
||||||
|
# @license MIT License <https://opensource.org/licenses/MIT>
|
||||||
|
# @link https://github.com/jkaninda/pg-bkup
|
||||||
|
#
|
||||||
set -e
|
set -e
|
||||||
TIME=$(date +%Y%m%d_%H%M%S)
|
TIME=$(date +%Y%m%d_%H%M%S)
|
||||||
arg0=$(basename "$0" .sh)
|
arg0=$(basename "$0" .sh)
|
||||||
|
|||||||
Reference in New Issue
Block a user