[英]How to set default app to open log-files despite changing file endings (in MobaXterm)?
Is there a way to set the default application for those log files even if the file endings are constantly changing? 即使文件结尾不断变化,是否有办法为这些日志文件设置默认应用程序?
I am working on MobaXterm, and after running some code through a *.pbs file I get the error and output log files in the form: 我正在MobaXterm上工作,并且通过* .pbs文件运行了一些代码之后,出现错误并以以下形式输出日志文件:
sample_code.o23456
sample_code.e23456
When I am opening the log files I am asked to set a default app and to choose an app to open the log files. 当我打开日志文件时,系统会要求我设置默认应用程序并选择一个应用程序来打开日志文件。
The next time I execute it the file endings will have changed 下次执行该文件时,文件结尾将更改
sample_code.o23457
sample_code.e23457
Which will leave me again with selecting the app to open the log files. 选择应用程序打开日志文件将再次让我离开。
This is time consuming. 这很费时间。
Is there a way to set the default application for those log files even if the file endings are constantly changing? 即使文件结尾不断变化,是否有办法为这些日志文件设置默认应用程序?
Note : I am coding in python if that helps and I found this but I don't really want to mess with the log handler. 注意 :如果可以,我正在使用python进行编码,我发现了这一点,但是我真的不想弄乱日志处理程序。
Edit : Okay this is what I found out so far. 编辑 :好的, 这是我到目前为止发现的。 One can set the default editor, but this is not solving my problem with the changing file endings. 可以设置默认编辑器,但这不能解决文件结尾更改带来的问题。
The answer lies within the *.pbs file 答案在* .pbs文件中
You can rename the pbs directive by adding following lines for the output and error logs to the *.pbs script, choosing names and file endings that suit your purpose (in my case just having the same endings every time to choose a default application to open the log files): 您可以通过在* .pbs脚本中添加以下输出和错误日志行,重命名pbs指令,选择适合您目的的名称和文件结尾(在我的情况下,每次选择默认应用程序打开时,它们的结尾都相同)日志文件):
#PBS -o output.log
#PBS -e error.log
Once I got into this I found even more nice things which could be interesting: 一旦我了解了这一点,我发现了更多有趣的事情:
Combine output and error log with: 将输出和错误日志与:
$ qsub -o output.log -j oe your.pbs
Place the joined output in another location other than the working directory 将合并的输出放置在工作目录以外的其他位置
$ qsub -o $HOME/tutorials/logs/output.log -j oe your.pbs
Using the *.pbs script created earlier, submit a job that emails you for all conditions: 使用先前创建的* .pbs脚本,提交一份可以通过电子邮件发送所有条件的作业:
$ qsub -m abe -M NetID@nyu.edu your.pbs
Note : More and in greater detail can be found here 注意 :更多和更详细的信息可以在这里找到
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.