Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/databases/autobackupmysql/files/patch-autobackupmysql.sh
18160 views
1
--- autobackupmysql.sh.orig 2009-12-18 13:23:34.000000000 +0100
2
+++ autobackupmysql.sh 2011-12-13 13:18:11.000000000 +0100
3
@@ -1,4 +1,4 @@
4
-#!/bin/bash
5
+#!/usr/local/bin/bash
6
#
7
# Automatic MySQL Backup Script
8
# VER. 1.1 - http://sourceforge.net/projects/autobackupmysql/
9
@@ -292,6 +292,7 @@
10
LOGERR=$BACKUPDIR/ERRORS_$DBHOST-`date +%N`.log # Logfile Name
11
BACKUPFILES=""
12
OPT="--quote-names --opt" # OPT string for use with mysqldump ( see man mysqldump )
13
+UNAME_S="`uname -s | tr "[:upper:]" "[:lower:]"`" # identify operating system
14
15
# Add --compress mysqldump option to $OPT
16
if [ "$COMMCOMP" = "yes" ];
17
@@ -440,7 +441,8 @@
18
# If DBs are excluded
19
for exclude in $DBEXCLUDE
20
do
21
- DBNAMES=`echo $DBNAMES | sed "s/\b$exclude\b//g"`
22
+ [ "$UNAME_S" = "linux" ] && DBNAMES=`echo $DBNAMES | sed "s/\b$exclude\b//g"`
23
+ [ "$UNAME_S" = "freebsd" ] && DBNAMES=`echo $DBNAMES | sed "s/[[:<:]]$exclude[[:>:]]//g"`
24
done
25
26
MDBNAMES=$DBNAMES
27
28