增量式备份

This commit is contained in:
zhangkun9038@dingtalk.com 2023-07-15 22:30:06 +08:00
parent 82e5dd55f5
commit f9e76f61ac

View File

@ -43,7 +43,7 @@ echo "$CURRENT_BINLOG $CURRENT_POSITION" > "last_backup.txt"
backup_files=()
find "$backUpPath" -name "${backUpPath}/${dbName}-incremental-*.sql.gz" -type f -print0 | while IFS= read -r -d '' file; do
find "$backUpPath" -wholename "${backUpPath}/${dbName}-incremental-*.sql.gz" -type f -print0 | while IFS= read -r -d '' file; do
file_date=$(stat -c %Y "$file")
current_time=$(date +%s)
if (( (current_time - file_date) > 86400 )); then