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.
|
||||
22
README.md
22
README.md
@@ -8,7 +8,7 @@ Postgres Backup tool, backup database to S3 or Object Storage
|
||||
- Docker
|
||||
- Kubernetes
|
||||
|
||||
> Links:
|
||||
## Links:
|
||||
|
||||
- [Docker Hub](https://hub.docker.com/r/jkaninda/pg-bkup)
|
||||
- [Github](https://github.com/jkaninda/pg-bkup)
|
||||
@@ -21,6 +21,12 @@ Postgres Backup tool, backup database to S3 or Object Storage
|
||||
- local
|
||||
- s3
|
||||
- Object storage
|
||||
|
||||
## Volumes:
|
||||
|
||||
- /s3mnt => S3 mounting path
|
||||
- /backup => local storage mounting path
|
||||
|
||||
## Usage
|
||||
|
||||
| Options | Shorts | Usage |
|
||||
@@ -306,4 +312,16 @@ spec:
|
||||
- name: S3_ENDPOINT
|
||||
value: "https://s3.us-west-2.amazonaws.com"
|
||||
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
|
||||
TIME=$(date +%Y%m%d_%H%M%S)
|
||||
arg0=$(basename "$0" .sh)
|
||||
|
||||
Reference in New Issue
Block a user