Skip to content

Commit

Permalink
Merge pull request #18 from anschluss-org/master
Browse files Browse the repository at this point in the history
Small changes for MacOS
  • Loading branch information
BigAndini authored May 2, 2018
2 parents 030b406 + de2eb9b commit be8283a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
13 changes: 11 additions & 2 deletions automysqlbackup
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,18 @@ load_default_config() {
CONFIG_encrypt_password='password0123'
}

# OS dependent options (showstoppers on MacOS)
if [[ $OSTYPE == darwin* ]]; then
OS_sed_option='-E'
OS_du_extra_option=''
else
OS_sed_option='-r'
OS_du_extra_option='--si'
fi

mysql_commands() {
VERSION=`mysql -V | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"`
NODOT_VER=`echo $VERSION | sed -r 's/\.//g'`
NODOT_VER=`echo $VERSION | sed $OS_sed_option 's/\.//g'`
if [ "${CONFIG_mysql_dump_encrypted_login}" = "yes" ]; then
export MYSQLDUMP="mysqldump --login-path=$CONFIG_mysql_dump_login_path"
export MYSQLSHOW="mysqlshow --login-path=$CONFIG_mysql_dump_login_path"
Expand Down Expand Up @@ -1994,7 +2003,7 @@ method_backup () {
# -> finished information
echo "Total disk space used for backup storage..."
echo "Size - Location"
echo `du -hs --si "${CONFIG_backup_dir}"`
echo `du -hs $OS_du_extra_option "${CONFIG_backup_dir}"`
echo
echo "======================================================================"
# <- finished information
Expand Down

0 comments on commit be8283a

Please sign in to comment.