check SQL vars are defined in details file
This commit is contained in:
parent
62107ed611
commit
5e7d2fe6d2
@ -381,6 +381,22 @@ printf "${cyan}[%s] -- [INFO] ${yellow}%s${cyan} imported --${norm}\n" \
|
||||
|
||||
|
||||
### dump sql databases
|
||||
|
||||
## verify SQL variables are defined in details file
|
||||
# sqlServer
|
||||
if [ -z "${sqlServer}" ]; then
|
||||
badDetails empty 'sqlServer'
|
||||
fi
|
||||
# sqlUser
|
||||
if [ -z "${sqlUser}" ]; then
|
||||
badDetails empty 'sqlUser'
|
||||
fi
|
||||
# sqlPass
|
||||
if [ -z "${sqlPass}" ]; then
|
||||
badDetails empty 'sqlPass'
|
||||
fi
|
||||
|
||||
## create tmp directory and generate dumpfile names
|
||||
printf "${cyan}[%s] -- [INFO] Dumping SQL databases --${norm}\n" \
|
||||
"$(stamp)" >> "$logFile"
|
||||
# create temporary directory to dump files before borg backup
|
||||
@ -396,6 +412,7 @@ printf "\n${yellow}%s/${cyan} --${norm}\n" "$sqlDumpDir" >> "$logFile"
|
||||
sqlDump_ccnet="backup-$(date +%Y%m%d_%H%M%S)_${ccnetDB_name}.sql"
|
||||
sqlDump_seafile="backup-$(date +%Y%m%d_%H%M%S)_${seafileDB_name}.sql"
|
||||
sqlDump_seahub="backup-$(date +%Y%m%d_%H%M%S)_${seahubDB_name}.sql"
|
||||
|
||||
## dump databases
|
||||
# dump CCNET-DB
|
||||
if ! mysqldump -h"${sqlServer}" -u"${sqlUser}" -p"${sqlPass}" \
|
||||
|
Loading…
Reference in New Issue
Block a user