Skip to content

Commit be8283a

Browse files
authored
Merge pull request #18 from anschluss-org/master
Small changes for MacOS
2 parents 030b406 + de2eb9b commit be8283a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

automysqlbackup

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,18 @@ load_default_config() {
100100
CONFIG_encrypt_password='password0123'
101101
}
102102

103+
# OS dependent options (showstoppers on MacOS)
104+
if [[ $OSTYPE == darwin* ]]; then
105+
OS_sed_option='-E'
106+
OS_du_extra_option=''
107+
else
108+
OS_sed_option='-r'
109+
OS_du_extra_option='--si'
110+
fi
111+
103112
mysql_commands() {
104113
VERSION=`mysql -V | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"`
105-
NODOT_VER=`echo $VERSION | sed -r 's/\.//g'`
114+
NODOT_VER=`echo $VERSION | sed $OS_sed_option 's/\.//g'`
106115
if [ "${CONFIG_mysql_dump_encrypted_login}" = "yes" ]; then
107116
export MYSQLDUMP="mysqldump --login-path=$CONFIG_mysql_dump_login_path"
108117
export MYSQLSHOW="mysqlshow --login-path=$CONFIG_mysql_dump_login_path"
@@ -1994,7 +2003,7 @@ method_backup () {
19942003
# -> finished information
19952004
echo "Total disk space used for backup storage..."
19962005
echo "Size - Location"
1997-
echo `du -hs --si "${CONFIG_backup_dir}"`
2006+
echo `du -hs $OS_du_extra_option "${CONFIG_backup_dir}"`
19982007
echo
19992008
echo "======================================================================"
20002009
# <- finished information

0 commit comments

Comments
 (0)