db 백업 스크립트 오류 질문
[root@cent2 BACKUP]# ./db_backup.sh ++ /usr/bin/hostname + HOST=cent2 + LOG=/tmp/backup.log + PUSH=/root/SHELL/monitor/tel_push.sh ++ /bin/date +%Y.%m.%d + DATE=2021.03.19 + BAK_LIST=/etc/my.cnf.d + BAK_PATH=/mnt/BACKUP/cent2 + BAK_FILE=/mnt/BACKUP/cent2/2021.03.19_cent2.tgz + DB_BAK_PATH=/root/SHELL/BACKUP/xtrabackup_backupfiles + DB_BAK_FILE=/mnt/BACKUP/cent2/2021.03.19_cent2_DB.tgz + /usr/bin/mount /mnt + /usr/bin/touch /tmp/backup.log + '[' -e /mnt/BACKUP/cent2 ']' + /bin/echo '백업 디렉토리가 있습니다.' 백업 디렉토리가 있습니다. + /bin/echo + /bin/echo '=== 백업 시작 시각 : ' + /bin/date + /bin/echo + /usr/bin/mariabackup --backup --no-lock --target-dir=/root/SHELL/BACKUP/xtrabackup_backupfiles [00] 2021-03-19 22:03:31 Connecting to MySQL server host: localhost, user: not set, password: not set, port: not set, socket: not set [00] 2021-03-19 22:03:31 Failed to connect to MySQL server: Access denied for user ''@'localhost' (using password: NO). + /usr/bin/mariabackup --prepare --target-dir=/root/SHELL/BACKUP/xtrabackup_backupfiles /usr/bin/mariabackup based on MariaDB server 10.3.27-MariaDB Linux (x86_64) /usr/bin/mariabackup: Can't change dir to '/root/SHELL/BACKUP/xtrabackup_backupfiles/' (errno: 2 "No such file or directory") [00] 2021-03-19 22:03:31 can't my_setwd /root/SHELL/BACKUP/xtrabackup_backupfiles/ + /usr/bin/tar -czpPf /mnt/BACKUP/cent2/2021.03.19_cent2.tgz /etc/my.cnf.d + /usr/bin/tar -czpPf /mnt/BACKUP/cent2/2021.03.19_cent2_DB.tgz /root/SHELL/BACKUP/xtrabackup_backupfiles /usr/bin/tar: /root/SHELL/BACKUP/xtrabackup_backupfiles: Cannot stat: No such file or directory /usr/bin/tar: Exiting with failure status due to previous errors ++ /usr/bin/ls -al /mnt/BACKUP/cent2/2021.03.19_cent2.tgz ++ awk '{print $9}' + NAME=/mnt/BACKUP/cent2/2021.03.19_cent2.tgz ++ /usr/bin/ls -al /mnt/BACKUP/cent2/2021.03.19_cent2.tgz ++ awk '{print $5}' + SIZE=1554 + /bin/echo '=== 백업 파일 정보: ' + /bin/echo ' | 파일명 : /mnt/BACKUP/cent2/2021.03.19_cent2.tgz' + /bin/echo ' | 파일크기 : 1554Byte' ++ /usr/bin/ls -al /mnt/BACKUP/cent2/2021.03.19_cent2_DB.tgz ++ awk '{print $9}' + NAME=/mnt/BACKUP/cent2/2021.03.19_cent2_DB.tgz ++ /usr/bin/ls -al /mnt/BACKUP/cent2/2021.03.19_cent2_DB.tgz ++ awk '{print $5}' + SIZE=45 + /bin/echo '=== DB백업 파일 정보: ' + /bin/echo ' | 파일명 : /mnt/BACKUP/cent2/2021.03.19_cent2_DB.tgz' + /bin/echo ' | 파일크기 : 45Byte' + /bin/echo + /bin/echo '=== 백업 종료 시각 : ' + /bin/date + /bin/echo + /usr/bin/umount /mnt ++ /usr/bin/cat /tmp/backup.log + /root/SHELL/monitor/tel_push.sh cent2 ' === 백업 시작 시각 : Fri Mar 19 22:03:31 UTC 2021 === 백업 파일 정보: | 파일명 : /mnt/BACKUP/cent2/2021.03.19_cent2.tgz | 파일크기 : 1554Byte === DB백업 파일 정보: | 파일명 : /mnt/BACKUP/cent2/2021.03.19_cent2_DB.tgz | 파일크기 : 45Byte === 백업 종료 시각 : Fri Mar 19 22:03:31 UTC 2021' + /usr/bin/rm -f /tmp/backup.log /root/SHELL/BACKUP/xtrabackup_backupfiles