I'm trying to save Snakemake's own console output (not the logs generated by the individual jobs) to an arbitrary file while still having it written to stdout/stderr. (Unfortunately, my setup means I can't just use tee.)
It looks to me like Snakemake should provide that functionality, given it saves the log output to a default location. However, looking through the documentation, I couldn't find a parameter to easily change the output location for the log. From the code of snakemake.logging, I'm getting the impression the logfile's parent directory may be hardcoded, with the file just getting a timestamped name.

有没有什么显而易见的方法来配置我忽略的Snakemake日志(log)文件?

推荐答案

文件名/路径以setup_logfile为硬编码.

这是一种技巧,但一种 Select 是使用onsuccess/onerror将日志(log)文件复制到所需位置(请注意,没有oncompletion,因此日志(log)复制可能适用于这两种情况):

onsuccess:
    shell("cp -v {log} some_path_for_log_copy.log")

onerror:
    shell("cp -v {log} some_path_for_log_copy.log")

Python相关问答推荐

TARete错误:类型对象任务没有属性模型'

根据在同一数据框中的查找向数据框添加值

为什么带有dropna=False的groupby会阻止后续的MultiIndex.dropna()工作?

不理解Value错误:在Python中使用迭代对象设置时必须具有相等的len键和值

图像 pyramid .难以创建所需的合成图像

如何使用根据其他值相似的列从列表中获取的中间值填充空NaN数据

使用@ guardlasses. guardlass和注释的Python继承

Python键入协议默认值

优化器的运行顺序影响PyTorch中的预测

Polars asof在下一个可用日期加入

将scipy. sparse矩阵直接保存为常规txt文件

基于另一列的GROUP-BY聚合将列添加到Polars LazyFrame

如何获取Python synsets列表的第一个内容?

使用字典或列表的值组合

如何在Python中使用Iscolc迭代器实现观察者模式?

从源代码显示不同的输出(机器学习)(Python)

如何在Python中将超链接添加到PDF中每个页面的顶部?

来自Airflow Connection的额外参数

TypeError:';Locator';对象无法在PlayWriter中使用.first()调用

多索引数据帧到标准索引DF