mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-07 14:09:41 +01:00
Update README.md
This commit is contained in:
60
README.md
60
README.md
@@ -16,6 +16,7 @@ MySQL Backup docker container image
|
|||||||
|
|
||||||
| Options | Shorts | Usage |
|
| Options | Shorts | Usage |
|
||||||
|---------------|--------|------------------------------------|
|
|---------------|--------|------------------------------------|
|
||||||
|
| mysql_bkup | bkup | Command utility |
|
||||||
| --operation | -o | Set operation (default: backup) |
|
| --operation | -o | Set operation (default: backup) |
|
||||||
| --destination | -d | Set destination (default: local) |
|
| --destination | -d | Set destination (default: local) |
|
||||||
| --source | -s | Set source (default: local) |
|
| --source | -s | Set source (default: local) |
|
||||||
@@ -70,7 +71,7 @@ services:
|
|||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- bkup --operation restore -file database_20231217_115621.sql
|
- bkup --operation restore --file database_20231217_115621.sql
|
||||||
volumes:
|
volumes:
|
||||||
- ./backup:/backup
|
- ./backup:/backup
|
||||||
environment:
|
environment:
|
||||||
@@ -85,6 +86,35 @@ services:
|
|||||||
```sh
|
```sh
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
## Backup to S3
|
||||||
|
Simple S3 backup usage
|
||||||
|
```yaml
|
||||||
|
mysql-bkup:
|
||||||
|
image: jkaninda/mysql-bkup:latest
|
||||||
|
container_name: mysql-bkup
|
||||||
|
tty: true
|
||||||
|
privileged: true
|
||||||
|
devices:
|
||||||
|
- "/dev/fuse"
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- mysql_bkup --operation restore -d s3 -f database_20231217_115621.sql
|
||||||
|
volumes:
|
||||||
|
- ./backup:/backup
|
||||||
|
environment:
|
||||||
|
- DB_PORT=3306
|
||||||
|
- DB_HOST=mysql
|
||||||
|
- DB_DATABASE=mariadb
|
||||||
|
- DB_USERNAME=mariadb
|
||||||
|
- DB_PASSWORD=password
|
||||||
|
- ACCESS_KEY=${ACCESS_KEY}
|
||||||
|
- SECRET_KEY=${SECRET_KEY}
|
||||||
|
- BUCKETNAME=${BUCKETNAME}
|
||||||
|
- S3_ENDPOINT=${S3_ENDPOINT}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## Run on Kubernetes
|
## Run on Kubernetes
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -120,31 +150,3 @@ spec:
|
|||||||
value: "password"
|
value: "password"
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
```
|
```
|
||||||
## Backup to S3
|
|
||||||
Simple backup usage
|
|
||||||
```yaml
|
|
||||||
mysql-bkup:
|
|
||||||
image: jkaninda/mysql-bkup:latest
|
|
||||||
container_name: mysql-bkup
|
|
||||||
tty: true
|
|
||||||
privileged: true
|
|
||||||
devices:
|
|
||||||
- "/dev/fuse"
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- mysql_bkup --operation restore -d s3 -f database_20231217_115621.sql
|
|
||||||
volumes:
|
|
||||||
- ./backup:/backup
|
|
||||||
environment:
|
|
||||||
- DB_PORT=3306
|
|
||||||
- DB_HOST=mysql
|
|
||||||
- DB_DATABASE=bkup
|
|
||||||
- DB_USERNAME=jonas
|
|
||||||
- DB_PASSWORD=password
|
|
||||||
- ACCESS_KEY=${ACCESS_KEY}
|
|
||||||
- SECRET_KEY=${SECRET_KEY}
|
|
||||||
- BUCKETNAME=${BUCKETNAME}
|
|
||||||
- S3_ENDPOINT=${S3_ENDPOINT}
|
|
||||||
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user