Skip to content

Commit

Permalink
Merge pull request #82 from jkaninda/docs
Browse files Browse the repository at this point in the history
docs: add docker recurring backup examples
  • Loading branch information
jkaninda authored Sep 29, 2024
2 parents 7038628 + 5a5e4de commit 74191ed
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ services:
networks:
web:
```
### Docker recurring backup
```shell
docker run --rm --network network_name \
-v $PWD/backup:/backup/ \
-e "DB_HOST=hostname" \
-e "DB_USERNAME=user" \
-e "DB_PASSWORD=password" \
jkaninda/pg-bkup backup -d dbName --cron-expression "@every 1m"
```
See: https://jkaninda.github.io/pg-bkup/reference/#predefined-schedules

## Deploy on Kubernetes

For Kubernetes, you don't need to run it in scheduled mode. You can deploy it as Job or CronJob.
Expand Down
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ services:
networks:
web:
```
### Docker recurring backup
```shell
docker run --rm --network network_name \
-v $PWD/backup:/backup/ \
-e "DB_HOST=hostname" \
-e "DB_USERNAME=user" \
-e "DB_PASSWORD=password" \
jkaninda/pg-bkup backup -d dbName --cron-expression "@every 1m"
```
See: https://jkaninda.github.io/pg-bkup/reference/#predefined-schedules

## Kubernetes

```yaml
Expand Down
8 changes: 5 additions & 3 deletions examples/docker-compose.scheduled.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ services:
pg-bkup:
image: jkaninda/pg-bkup
container_name: pg-bkup
command: backup --dbname database_name
command: backup --dbname database_name #--cron-expression "@every 5m"
volumes:
- ./backup:/backup
environment:
- DB_PORT=5432
- DB_HOST=postgress
- DB_HOST=postgres
- DB_USERNAME=userName
- DB_PASSWORD=${DB_PASSWORD}
- BACKUP_CRON_EXPRESSION=0 1 * * *
# Check https://jkaninda.github.io/pg-bkup/reference/#predefined-schedules
- BACKUP_CRON_EXPRESSION=@daily #@every 5m|@weekly | @monthly |0 1 * * *

3 changes: 2 additions & 1 deletion examples/docker-compose.scheduled.s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ services:
- AWS_SECRET_KEY=xxxxx
## In case you are using S3 alternative such as Minio and your Minio instance is not secured, you change it to true
- AWS_DISABLE_SSL="false"
- BACKUP_CRON_EXPRESSION=0 1 * * *
# Check https://jkaninda.github.io/pg-bkup/reference/#predefined-schedules
- BACKUP_CRON_EXPRESSION=@daily #@every 5m|@weekly | @monthly |0 1 * * *
# pg-bkup container must be connected to the same network with your database
networks:
- web
Expand Down

0 comments on commit 74191ed

Please sign in to comment.