简体   繁体   English

如何在更改文件结尾的情况下将默认应用设置为打开日志文件(在MobaXterm中)?

[英]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.

相关问题 创建日志文件 - Creating log-files 如何配置IPython 0.12将所有输入记录到按时间戳划分的日志文件中? 我在IPython 0.10.1中工作 - How can I configure IPython 0.12 to log all input to log-files split out by timestamp? I have this working in IPython 0.10.1 如何将 Spyder 设置为默认程序/应用程序以打开 (.py) Python 文件? - How to set Spyder as default program/app to open (.py) Python file? 如何使用 tkinter 应用程序默认打开文件? - How to make a file open by default with tkinter app? 如何在twisted中打开某些文件的新日志文件 - How to open new log file for certain files in twisted 如何使用python在默认程序中打开多个文件 - how to open multiple files in default program with python 如何打开当前目录中的所有.txt和.log文件,搜索并打印找到搜索的文件 - How to open all .txt and .log files in the current directory, search, and print the file the search was found 日志记录:如何设置日志文件的换行符? - Logging: How to set the newline character of log files? 是否可以为整个python项目设置默认日志文件? - Is it possible to set default log file for an entire python project? 如何将消息记录到通用(更改)文件中 - How can I log messages to generic (changing) files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM