diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ac320f2 --- /dev/null +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md index 1ff0633..73bd15c 100644 --- a/README.md +++ b/README.md @@ -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 -``` \ No newline at end of file +``` +## License + +This project is licensed under the MIT License. See the LICENSE file for details. + +## Authors + +**Jonas Kaninda** +- + +## Copyright + +Copyright (c) [2023] [Jonas Kaninda] diff --git a/example/docker-compose.local.yaml b/example/docker-compose.local.yaml new file mode 100644 index 0000000..c2c124c --- /dev/null +++ b/example/docker-compose.local.yaml @@ -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 \ No newline at end of file diff --git a/example/docker-compose.yaml b/example/docker-compose.yaml new file mode 100644 index 0000000..8fbeff0 --- /dev/null +++ b/example/docker-compose.yaml @@ -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 \ No newline at end of file diff --git a/k8s-job.yaml b/example/k8s-job.yaml similarity index 100% rename from k8s-job.yaml rename to example/k8s-job.yaml diff --git a/src/pg_bkup.sh b/src/pg_bkup.sh index 9496b48..f66d842 100755 --- a/src/pg_bkup.sh +++ b/src/pg_bkup.sh @@ -1,5 +1,10 @@ -#!/usr/bin/env bash - +#!/usr/bin/env bash + +# PosgreSQL Backup & Restore +# @author Jonas Kaninda +# @license MIT License +# @link https://github.com/jkaninda/pg-bkup +# set -e TIME=$(date +%Y%m%d_%H%M%S) arg0=$(basename "$0" .sh)