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
|
||||
# Copyright (C) 2013 - 2020 Teddysun <i@teddysun.com>
|
||||
# Copyright (C) 2013 - 2022 Teddysun <i@teddysun.com>
|
||||
#
|
||||
# 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"
|
||||
exit 1
|
||||
fi
|
||||
if [ "${MYSQL_DATABASE_NAME[@]}" == "" ]; then
|
||||
if [[ "${MYSQL_DATABASE_NAME[@]}" == "" ]]; then
|
||||
mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" --all-databases > "${SQLFILE}" 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
log "MySQL all databases backup failed"
|
||||
@ -218,7 +218,7 @@ start_backup() {
|
||||
fi
|
||||
|
||||
# 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}"
|
||||
rm -f ${sql}
|
||||
done
|
||||
@ -336,9 +336,9 @@ EOF
|
||||
clean_up_files() {
|
||||
cd ${LOCALDIR} || exit
|
||||
if ${ENCRYPTFLG}; then
|
||||
LS=($(ls *.enc))
|
||||
LS=($(ls *.enc 2> /dev/null))
|
||||
else
|
||||
LS=($(ls *.tgz))
|
||||
LS=($(ls *.tgz 2> /dev/null))
|
||||
fi
|
||||
for f in ${LS[@]}; do
|
||||
get_file_date ${f}
|
||||
|
Loading…
x
Reference in New Issue
Block a user