From 6113bf64b20fda5fc6767b76e82932c6c85ee8be Mon Sep 17 00:00:00 2001 From: Dave Conroy Date: Wed, 22 Apr 2020 05:36:03 -0700 Subject: [PATCH] Update README.md --- README.md | 4 ++-- install/etc/s6/services/10-db-backup/run | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 266d720..82c53a1 100644 --- a/README.md +++ b/README.md @@ -137,10 +137,10 @@ $ cat post-script.sh ## $7=FILESIZE (Filesize of backup) ## $8=MD5_RESULT (MD5Sum if enabled) -echo "${1} Backup Completed on ${2} for ${3} on ${4} ${5}. Filename: ${5} Size: ${6} MD5: ${7}" +echo "${1} Backup Completed on ${2} for ${3} on ${4} ${5}. Filename: ${6} Size: ${7} bytes MD5: ${8}" ```` Outputs the following on the console: `mysql Backup Completed on example-db for example on 2020-04-22 05:19:10. Filename: mysql_example_example-db_20200422-051910.sql.bz2 Size: 7795 bytes MD5: 952fbaafa30437494fdf3989a662cd40` -If you wish to change the size value from bytes to megabytes set environment variable `SIZE_VALUE=megabytes` \ No newline at end of file +If you wish to change the size value from bytes to megabytes set environment variable `SIZE_VALUE=megabytes` diff --git a/install/etc/s6/services/10-db-backup/run b/install/etc/s6/services/10-db-backup/run index f0d53da..100e2e2 100755 --- a/install/etc/s6/services/10-db-backup/run +++ b/install/etc/s6/services/10-db-backup/run @@ -12,6 +12,8 @@ fi ### Sanity Test sanity_var DB_TYPE "Database Type" sanity_var DB_HOST "Database Host" +file_env 'DB_USER' +file_env 'DB_PASS' ### Set Defaults COMPRESSION=${COMPRESSION:-GZ} @@ -25,9 +27,9 @@ DBPASS=${DB_PASS} DBUSER=${DB_USER} DBTYPE=${DB_TYPE} MD5=${MD5:-TRUE} +SIZE_VALUE=${SIZE_VALUE:-"bytes"} SPLIT_DB=${SPLIT_DB:-FALSE} TMPDIR=/tmp/backups -SIZE_VALUE=${SIZE_VALUE:-"bytes"} if [ "$1" = "NOW" ]; then DB_DUMP_BEGIN=+0