欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 时评 > Insar结合ISCE2,某一个文件进行并行-stackSentinel.py

Insar结合ISCE2,某一个文件进行并行-stackSentinel.py

2025/3/14 20:28:10 来源:https://blog.csdn.net/kangkangluoluo/article/details/146204054  浏览:    关键词:Insar结合ISCE2,某一个文件进行并行-stackSentinel.py

stackSentinel.py

依次执行 run_01 到 run_15,记录各自的日志

并行执行 run_16 里的所有命令,仍然记录日志

不知道对不对,测试的时间有点长就给停了

#!/bin/bash# ✅ 适用于 WSL/Linux
runfiles_path="/mnt/e/insar_order_test/Stacks/run_files"
log_dir="/mnt/e/insar_order_test/logs"# 创建日志目录(如果不存在)
mkdir -p "$log_dir"# 依次执行 run_01 到 run_15,并记录日志
for file in $(ls $runfiles_path/run_??_* 2>/dev/null | grep -v "run_16" | sort); dolog_file="$log_dir/$(basename "$file").log"echo "=============================================" | tee -a "$log_file"echo "Executing: $file" | tee -a "$log_file"echo "======= Contents of $file =======" | tee -a "$log_file"cat "$file" 2>/dev/null | tee -a "$log_file"echo "=============================================" | tee -a "$log_file"# 执行文件,并同时在终端打印和日志保存bash "$file" | tee -a "$log_file"echo "✅ Execution of $file completed!" | tee -a "$log_file"
done# ✅ 并行执行 run_16 里面的所有命令
run_16_file="$runfiles_path/run_16"
log_16="$log_dir/run_16.log"if [ -f "$run_16_file" ]; thenecho "🔄 开始并行执行 run_16 命令..." | tee -a "$log_16"cat "$run_16_file" | tee -a "$log_16" | parallel -j 8 --joblog "$log_dir/parallel_run_16.log" | tee -a "$log_16"echo "✅ run_16 命令全部执行完成!" | tee -a "$log_16"
elseecho "⚠️ 警告:run_16 文件未找到,跳过该步骤!" | tee -a "$log_dir/run_all.log"
fiecho "✅ 所有任务已按顺序执行完成!" | tee -a "$log_dir/run_all.log"

在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词