Skip to content

Commit

Permalink
Merge pull request #55 from deitch/fix-docs
Browse files Browse the repository at this point in the history
Fix typos in README and comments
  • Loading branch information
deitch committed Aug 17, 2018
2 parents 4a56cc4 + d0dd6b8 commit 7d5c3a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ docker run -d --restart=always -e DB_USER=user123 -e DB_PASS=pass123 -e DB_DUMP_
### Dump Target
The dump target is where you want the backup files to be saved. The backup file *always* is a gzipped file the following format:

`db_backup_YYYYMMDDHHmm.sql.gz`
`db_backup_YYYYMMDDHHmm.gz`

Where:

Expand Down Expand Up @@ -179,15 +179,15 @@ __You should consider the [use of `--env-file=`](https://docs.docker.com/engine/

Examples:

1. Restore from a local file: `docker run -e DB_SERVER=gotodb.example.com -e DB_USER=user123 -e DB_PASS=pass123 -e DB_RESTORE_TARGET=/backup/db_backup_201509271627.sql.gz -v /local/path:/backup deitch/mysql-backup`
2. Restore from an SMB file: `docker run -e DB_SERVER=gotodb.example.com -e DB_USER=user123 -e DB_PASS=pass123 -e DB_RESTORE_TARGET=smb://smbserver/share1/backup/db_backup_201509271627.sql.gz deitch/mysql-backup`
3. Restore from an S3 file: `docker run -e DB_SERVER=gotodb.example.com -e AWS_ACCESS_KEY_ID=awskeyid -e AWS_SECRET_ACCESS_KEY=secret -e AWS_DEFAULT_REGION=eu-central-1 -e DB_USER=user123 -e DB_PASS=pass123 -e DB_RESTORE_TARGET=s3://bucket/path/db_backup_201509271627.sql.gz deitch/mysql-backup`
1. Restore from a local file: `docker run -e DB_SERVER=gotodb.example.com -e DB_USER=user123 -e DB_PASS=pass123 -e DB_RESTORE_TARGET=/backup/db_backup_201509271627.gz -v /local/path:/backup deitch/mysql-backup`
2. Restore from an SMB file: `docker run -e DB_SERVER=gotodb.example.com -e DB_USER=user123 -e DB_PASS=pass123 -e DB_RESTORE_TARGET=smb://smbserver/share1/backup/db_backup_201509271627.gz deitch/mysql-backup`
3. Restore from an S3 file: `docker run -e DB_SERVER=gotodb.example.com -e AWS_ACCESS_KEY_ID=awskeyid -e AWS_SECRET_ACCESS_KEY=secret -e AWS_DEFAULT_REGION=eu-central-1 -e DB_USER=user123 -e DB_PASS=pass123 -e DB_RESTORE_TARGET=s3://bucket/path/db_backup_201509271627.gz deitch/mysql-backup`

### Restore when using docker-compose
`docker-compose` automagically creates a network when started. `docker run` simply attaches to the bridge network. If you are trying to communicate with a mysql container started by docker-compose, you'll need to specify the network in your command arguments. You can use `docker network ls` to see what network is being used, or you can declare a network in your docker-compose.yml.

#### Example:
`docker run -e DB_SERVER=gotodb.example.com -e DB_USER=user123 -e DB_PASS=pass123 -e DB_RESTORE_TARGET=/backup/db_backup_201509271627.sql.gz -v /local/path:/backup --network="skynet" deitch/mysql-backup`
`docker run -e DB_SERVER=gotodb.example.com -e DB_USER=user123 -e DB_PASS=pass123 -e DB_RESTORE_TARGET=/backup/db_backup_201509271627.gz -v /local/path:/backup --network="skynet" deitch/mysql-backup`

### Using docker (or rancher) secrets
Environment variables used in this image can be passed in files as well. This is useful when you are using docker (or rancher) secrets for storing sensitive information.
Expand Down
6 changes: 3 additions & 3 deletions entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ declare -A uri


if [[ -n "$DB_RESTORE_TARGET" ]]; then
# Execute additional scripts for pre backup restore porcessing. For example,
# Execute additional scripts for pre backup restore processing. For example,
# uncompress a tarball that contains the tarballs for the sql dump and a
# wordpress installation.
if [ -d /scripts.d/pre-restore/ ]; then
Expand Down Expand Up @@ -116,7 +116,7 @@ if [[ -n "$DB_RESTORE_TARGET" ]]; then
echo "Could not find restore file $DB_RESTORE_TARGET"
exit 1
fi
# Execute additional scripts for post backup restore porcessing. For example,
# Execute additional scripts for post backup restore processing. For example,
# uncompress a tarball that contains the files of a wordpress installation
if [ -d /scripts.d/post-restore/ ]; then
for i in $(ls /scripts.d/post-restore/*.sh); do
Expand Down Expand Up @@ -183,7 +183,7 @@ else
# make the dump
mysqldump -h $DB_SERVER -P $DB_PORT $DBUSER $DBPASS $DB_LIST $DUMPVARS | gzip > ${TMPDIR}/${TARGET}

# Execute additional scripts for post porcessing. For example, create a new
# Execute additional scripts for post processing. For example, create a new
# backup file containing this db backup and a second tar file with the
# contents of a wordpress install.
if [ -d /scripts.d/post-backup/ ]; then
Expand Down

0 comments on commit 7d5c3a1

Please sign in to comment.