sql dump
This commit is contained in:
parent
ba2517138e
commit
a72a8ac450
@ -458,26 +458,18 @@ cd "$mailcowPath"
|
|||||||
echo -e "${op}${stamp} Stopping postfix and dovecot containers now..." \
|
echo -e "${op}${stamp} Stopping postfix and dovecot containers now..." \
|
||||||
"${normal}" >> "$logFile"
|
"${normal}" >> "$logFile"
|
||||||
docker-compose stop --timeout ${dockerStopTimeout} 2>> "$logFile"
|
docker-compose stop --timeout ${dockerStopTimeout} 2>> "$logFile"
|
||||||
# docker-compose always returns an error code of 0, so there is no point error
|
# docker-compose always returns an error code of 0, so there is no point in
|
||||||
# checking
|
# error checking
|
||||||
echo -e "${op}${stamp} ...done${normal}" >> "$logFile"
|
echo -e "${op}${stamp} ...done (verify in docker logs)${normal}" >> "$logFile"
|
||||||
|
|
||||||
|
|
||||||
### Dump SQL
|
### Dump SQL
|
||||||
echo -e "${op}${stamp} Dumping NextCloud SQL database...${normal}" >> "$logFile"
|
echo -e "${op}${stamp} Dumping mailcow SQL database...${normal}" >> "$logFile"
|
||||||
mysqldump --single-transaction -h"${sqlParams[0]}" -u"${sqlParams[1]}" \
|
docker-compose exec mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > "$sqlDumpDir/$sqlDumpFile"
|
||||||
-p"${sqlParams[2]}" "${sqlParams[3]}" > "${sqlDumpDir}/${sqlDumpFile}" \
|
# docker-compose always returns an error code of 0, so there is no point in
|
||||||
2>> "$logFile"
|
# error checking
|
||||||
# verify
|
echo -e "${op}${stamp} ...done (verify in docker logs)${normal}" >> "$logFile"
|
||||||
dumpResult="$?"
|
|
||||||
if [ "$dumpResult" = "0" ]; then
|
|
||||||
echo -e "${ok}${stamp} -- [SUCCESS] SQL dumped successfully --${normal}" \
|
|
||||||
>> "$logFile"
|
|
||||||
else
|
|
||||||
exitError+=('200')
|
|
||||||
cleanup
|
|
||||||
quit
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Call borgbackup to copy actual files
|
### Call borgbackup to copy actual files
|
||||||
echo -e "${op}${stamp} Pre-backup tasks completed, calling borgbackup..." \
|
echo -e "${op}${stamp} Pre-backup tasks completed, calling borgbackup..." \
|
||||||
|
Loading…
Reference in New Issue
Block a user