From 7f272b28217d6e375ee4d8534ea66fe992614fcf Mon Sep 17 00:00:00 2001 From: Yawasau <229953100a@gmail.com> Date: Sun, 12 Jun 2022 15:01:29 +0800 Subject: [PATCH] bugfix --- tools/bin/tools.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/bin/tools.sh b/tools/bin/tools.sh index 69f6eb9..d76cf06 100644 --- a/tools/bin/tools.sh +++ b/tools/bin/tools.sh @@ -376,8 +376,12 @@ Backup_data() { echo_log "備份$1數據" if [[ $result = 0 ]]; then if [[ $zsize != "" ]]; then - echo "#$1Size=\"$(du -ks "$data_path" | awk '{print $1}')\"" >>"$app_details" [[ $2 != $(cat "$app_details" | awk "/$1path/"'{print $1}' | cut -f2 -d '=' | tail -n1 | sed 's/\"//g') ]] && echo "#$1path=\"$2\"" >>"$app_details" + if [[ $Size != "" ]]; then + echo "$(cat "$app_details" | sed "s/$Size/$(du -ks "$data_path" | awk '{print $1}')/g")">"$app_details" + else + echo "#$1Size=\"$(du -ks "$data_path" | awk '{print $1}')\"" >>"$app_details" + fi else if [[ $Size != "" ]]; then echo "$(cat "$app_details" | sed "s/$Size/$(du -ks "$data_path" | awk '{print $1}')/g")">"$app_details"