It should be possible to hack up a script that calls ps(1) with a format string argument that causes it to print only the fields you care about (i.e. cpu time, username, pid), then process that output using a shellscript like grep -f file-with-one-username-per-line while read cputime username pid; do [ "$cputime" -gt max-cpu-time ] && kill -9 $pid; done, but this would be reinventing the Auto Nice Daemon.
tagged gold hack script
2ff7e9595c
コメント