UltimateByte 9 سال پیش
والد
کامیت
18b0648541
1فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 6 6
      lgsm/functions/command_backup.sh

+ 6 - 6
lgsm/functions/command_backup.sh

@@ -127,11 +127,11 @@ fn_script_log "Compression over"
 
 # Check tar exit code and set the result
 fn_check_tar_exit(){
-	if [ $? == 0 ]; then
-		backupresult="FAIL"
-	else
-		backupresult="PASS"
-	fi
+if [ $? == 0 ]; then
+	backupresult="PASS"
+else
+	backupresult="FAIL"
+fi
 }
 
 # Remove lockfile
@@ -148,7 +148,7 @@ fn_backup_summary(){
 		fn_print_ok_nl "Backup created: ${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
 		fn_script_log_pass "Backup created: ${backupdir}/${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
 	# When backupresult="FAIL"
-	elif [ "${backupresult}" == "PASS" ]; then
+	elif [ "${backupresult}" == "FAIL" ]; then
 		fn_print_error_nl "Backup failed: ${backupname}.tar.gz"
 		fn_script_log_error "Backup failed: ${backupname}.tar.gz"
 		core_exit.sh