Skip to content

Commit

Permalink
Merge pull request #96 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 2ba1b51 + fdc88e6 commit 726fd14
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ 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/mysql-bkup backup -d dbName --cron-expression "@every 1m"
```
See: https://jkaninda.github.io/mysql-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 All @@ -102,7 +115,7 @@ spec:
template:
spec:
containers:
- name: pg-bkup
- name: mysql-bkup
# In production, it is advised to lock your image tag to a proper
# release version instead of using `latest`.
# Check https://github.com/jkaninda/mysql-bkup/releases
Expand Down
Binary file added docs/favicon.ico
Binary file not shown.
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,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/mysql-bkup backup -d dbName --cron-expression "@every 1m"
```
See: https://jkaninda.github.io/mysql-bkup/reference/#predefined-schedules

## Kubernetes

```yaml
Expand Down
3 changes: 2 additions & 1 deletion examples/docker-compose.scheduled.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ services:
- DB_HOST=mysql
- DB_USERNAME=userName
- DB_PASSWORD=${DB_PASSWORD}
- BACKUP_CRON_EXPRESSION=0 1 * * * # Optional
# See: https://jkaninda.github.io/mysql-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 * * * # Optional
# See: https://jkaninda.github.io/mysql-bkup/reference/#predefined-schedules
- BACKUP_CRON_EXPRESSION=@daily #@every 5m|@weekly | @monthly |0 1 * * *
# mysql-bkup container must be connected to the same network with your database
networks:
- web
Expand Down

0 comments on commit 726fd14

Please sign in to comment.