|
@@ -8,13 +8,16 @@ date_str = now.strftime("%Y-%m-%d")
|
|
|
# 定义日志文件名
|
|
|
log_file = f"script_output_{date_str}.log"
|
|
|
|
|
|
+n1 = 1
|
|
|
+n2 = 5
|
|
|
+
|
|
|
# 定义Shell脚本的路径
|
|
|
script1_path = "./script1.sh"
|
|
|
-script2_path = "./script1.sh"
|
|
|
+script2_path = "./script2.sh"
|
|
|
|
|
|
with open(log_file, 'w') as f:
|
|
|
# 调用script1.sh
|
|
|
- result = subprocess.run([script1_path], shell=True, stdout=f, stderr=subprocess.STDOUT)
|
|
|
+ result = subprocess.run([script1_path, str(n1), str(n2)], shell=True, stdout=f, stderr=subprocess.STDOUT)
|
|
|
|
|
|
# 检查返回码
|
|
|
if result.returncode == 0:
|