From 64cca4ea93c16e11ec7eab999b467f0de5df507c Mon Sep 17 00:00:00 2001 From: lsy Date: Mon, 22 Jul 2024 00:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E9=80=89=E5=A4=87=E4=BB=BD=E8=84=9A?= =?UTF-8?q?=E6=9C=AC,=E5=8E=BB=E9=99=A4=E5=86=97=E4=BD=99=E5=91=BD?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/code/backups/backups_file_mysql_cloud.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/shell/code/backups/backups_file_mysql_cloud.sh b/shell/code/backups/backups_file_mysql_cloud.sh index 6fe4712..43aa9b6 100644 --- a/shell/code/backups/backups_file_mysql_cloud.sh +++ b/shell/code/backups/backups_file_mysql_cloud.sh @@ -22,14 +22,12 @@ for item in "${mysql_arry[@]}"; do # 切换到网站目录进行压缩 cd "${web_path}/${item}/" || exit zip -r "${item}_web_${date_time}.zip" . - # 移动压缩文件回原始目录 - mv "${item}_web_${date_time}.zip" "$original_dir" - # 返回原始目录 - cd "$original_dir" || exit # 将数据库SQL文件和网站压缩包一起压缩 zip "${item}_${date_time}.zip" "${item}_${date_time}.sql" "${item}_web_${date_time}.zip" # 删除临时的网站压缩包 rm "${item}_web_${date_time}.zip" + # 返回原始目录 + cd "$original_dir" || exit else # 否则,只压缩数据库 zip "${item}_${date_time}.zip" "${item}_${date_time}.sql" @@ -51,15 +49,13 @@ for item in "${web_arry[@]}"; do # 切换到网站目录进行压缩 cd "${web_path}/${item}/" || exit zip -r "${item}_${date_time}_data.zip" . - # 移动压缩文件回原始目录 - mv "${item}_${date_time}_data.zip" "$original_dir" - # 返回原始目录 - cd "$original_dir" || exit # 上传到百度网盘存储 bypy upload "${item}_${date_time}.zip" "/${item}/" # 上传到阿里云盘 aliyunpan upload "${item}_${date_time}.zip" "/网站/${item}/${year}/" # 删除文件 rm "${item}_${date_time}_data.zip" + # 返回原始目录 + cd "$original_dir" || exit fi done \ No newline at end of file