refs #8414 Date format Fix
This commit is contained in:
parent
37bbc13bfd
commit
4e193aa116
|
@ -6,7 +6,9 @@ myDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
. "$myDir/config.sh"
|
. "$myDir/config.sh"
|
||||||
|
|
||||||
backupFile=$1
|
backupFile=$1
|
||||||
formatted_date=$(date -d "$fecha" +"%Y%m%d")
|
formatted_date() {
|
||||||
|
date '+%Y-%m-%d %H:%M:%S'
|
||||||
|
}
|
||||||
|
|
||||||
if [ -z "$backupFile" ]; then
|
if [ -z "$backupFile" ]; then
|
||||||
echo "Backup file not defined."
|
echo "Backup file not defined."
|
||||||
|
@ -23,7 +25,7 @@ echo "Restoring MySQL data from backup."
|
||||||
rm -rf "$restoreDir"
|
rm -rf "$restoreDir"
|
||||||
mkdir -p "$restoreDir"
|
mkdir -p "$restoreDir"
|
||||||
|
|
||||||
echo $formatted_date
|
echo "$(formatted_date)"
|
||||||
echo "Decompresing backup."
|
echo "Decompresing backup."
|
||||||
gzip --decompress --stdout "$backupFile" \
|
gzip --decompress --stdout "$backupFile" \
|
||||||
| mbstream -x --directory="$restoreDir"
|
| mbstream -x --directory="$restoreDir"
|
||||||
|
@ -34,7 +36,7 @@ mariabackup \
|
||||||
--prepare \
|
--prepare \
|
||||||
--target-dir="$restoreDir"
|
--target-dir="$restoreDir"
|
||||||
|
|
||||||
echo $formatted_date
|
echo "$(formatted_date)"
|
||||||
echo "Stopping service."
|
echo "Stopping service."
|
||||||
service mariadb stop
|
service mariadb stop
|
||||||
if pgrep mariadbd; then pkill -9 mariadbd; fi
|
if pgrep mariadbd; then pkill -9 mariadbd; fi
|
||||||
|
|
Loading…
Reference in New Issue