通过 grep qstat 输出并将 jobid 发送到 qdel 来删除作业?
我在集群上使用 PBS 作业调度程序,并且我想使用 qdel
删除早于特定日期的作业;或者,能够按日期对 qstat
结果进行排序就足够了。
qstat
给出以下输出:
job-ID prior name user state submit/start at queue slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
326539 0.50500 run user r 01/06/2011 11:13:34 [email protected] 1
326594 0.50500 run user r 01/06/2011 11:13:34 [email protected] 1
我可以使用 qdel
删除作业:
qdel 326539
并且可以使用 grep
找到我要删除的作业:
qstat > foo; grep 01/06 foo
我当前的工作周围的方法是将上面的输出粘贴到电子表格中,按作业 ID 排序,然后 qdel {min..max}
,
我可以将这些步骤合并到一个命令中吗?
感谢您的帮助。
I am using PBS job scheduler on my cluster, and I would like to delete jobs older than a certain date using qdel
; alternatively it would be sufficient to be able to sort the results of qstat
by date.
qstat
gives this output:
job-ID prior name user state submit/start at queue slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
326539 0.50500 run user r 01/06/2011 11:13:34 [email protected] 1
326594 0.50500 run user r 01/06/2011 11:13:34 [email protected] 1
and I can delete jobs with qdel
:
qdel 326539
and the jobs I want to delete can be located using grep
:
qstat > foo; grep 01/06 foo
my current work around is to paste the output from above into a spreadsheet, sort by job-ID, and then qdel {min..max}
,
Can I combine these steps into a single command?
Assistance appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
awk
Bash
如果您想进行空运行,请将
qdel "$1"
更改为echo qdel "$1"
看看它会做什么。awk
Bash
If you want to do a dry-run, then change
qdel "$1"
toecho qdel "$1"
to see what it would have done.