From 17506e7b902e3c83b3fa0c3163739ca3b0c90ac2 Mon Sep 17 00:00:00 2001 From: lsy2246 Date: Sat, 6 Apr 2024 18:17:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=87=E4=BB=BD=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E9=94=99=E8=AF=AF,=E6=B7=BB=E5=8A=A0=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=A4=87=E4=BB=BD=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/code/backups.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/code/backups.sh b/shell/code/backups.sh index eb974e3..fab3645 100644 --- a/shell/code/backups.sh +++ b/shell/code/backups.sh @@ -12,14 +12,16 @@ for item in ${mysql_arry[@]};do mkdir -p "$item/$year" mysqldump -u $user -p$password ${item} > "${item}_${date_time}.sql" zip "./$item/$year/${item}_${date_time}.zip" "./${item}_${date_time}.sql" + rm "./${item}_${date_time}.sql" done for item in ${web_arry[@]};do mkdir -p "./$item/$year" - zip -r "./${item}_${date_time}_data.zip" "/${item}" + zip -r "./${item}_${date_time}_data.zip" "${web_path}/${item}" if [ -f "./$item/$year/${item}_${date_time}.zip" ];then - zip -u "./${item}_${date_time}.zip" "./${item}_${date_time}_data.zip" + zip -u "./$item/$year/${item}_${date_time}.zip" "./${item}_${date_time}_data.zip" else zip "./$item/$year/${item}_${date_time}.zip" "./${item}_${date_time}_data.zip" fi + rm "./${item}_${date_time}_data.zip" done