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