mirror of
https://github.com/teddysun/across.git
synced 2025-01-18 13:59:35 +08:00
Update comments
Don't show error message when executing `ls` command Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
parent
973ce29038
commit
f0f1a1fb2f
10
backup.sh
10
backup.sh
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Copyright (C) 2013 - 2020 Teddysun <i@teddysun.com>
|
# Copyright (C) 2013 - 2022 Teddysun <i@teddysun.com>
|
||||||
#
|
#
|
||||||
# This file is part of the LAMP script.
|
# This file is part of the LAMP script.
|
||||||
#
|
#
|
||||||
@ -168,7 +168,7 @@ EOF
|
|||||||
log "MySQL root password is incorrect. Please check it and try again"
|
log "MySQL root password is incorrect. Please check it and try again"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "${MYSQL_DATABASE_NAME[@]}" == "" ]; then
|
if [[ "${MYSQL_DATABASE_NAME[@]}" == "" ]]; then
|
||||||
mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" --all-databases > "${SQLFILE}" 2>/dev/null
|
mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" --all-databases > "${SQLFILE}" 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
log "MySQL all databases backup failed"
|
log "MySQL all databases backup failed"
|
||||||
@ -218,7 +218,7 @@ start_backup() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete MySQL temporary dump file
|
# Delete MySQL temporary dump file
|
||||||
for sql in $(ls ${TEMPDIR}*.sql); do
|
for sql in $(ls ${TEMPDIR}*.sql 2> /dev/null); do
|
||||||
log "Delete MySQL temporary dump file: ${sql}"
|
log "Delete MySQL temporary dump file: ${sql}"
|
||||||
rm -f ${sql}
|
rm -f ${sql}
|
||||||
done
|
done
|
||||||
@ -336,9 +336,9 @@ EOF
|
|||||||
clean_up_files() {
|
clean_up_files() {
|
||||||
cd ${LOCALDIR} || exit
|
cd ${LOCALDIR} || exit
|
||||||
if ${ENCRYPTFLG}; then
|
if ${ENCRYPTFLG}; then
|
||||||
LS=($(ls *.enc))
|
LS=($(ls *.enc 2> /dev/null))
|
||||||
else
|
else
|
||||||
LS=($(ls *.tgz))
|
LS=($(ls *.tgz 2> /dev/null))
|
||||||
fi
|
fi
|
||||||
for f in ${LS[@]}; do
|
for f in ${LS[@]}; do
|
||||||
get_file_date ${f}
|
get_file_date ${f}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user