<分区>
在 Linux (CentOS 6) 上,如果运行时间超过 36 小时,我想终止其命令中包含“pkgacc”的进程(因此没有确切的命令,只是部分匹配)。
有相关问题:How do you kill all Linux processes that are older than a certain age?但是提供的任何解决方案都不适合我。
执行时:
if [[ "$(uname)" = "Linux" ]];then killall --older-than 1h someprocessname;fi
它只是返回关于如何使用 killall 的 killall 使用页面,在其手册页中没有提及“--older-than”开关。