Есть ли способ проверить, сколько заданий у пользователя в очереди?

5707
Jackson Hart

Я знаю такие команды, как qsub, qstat -a, qstat -an и т. Д.

Но как я могу узнать, сколько заданий в очереди у одного пользователя (не обязательно обязательно выполняется) в любой момент времени?

1

1 ответ на вопрос

5
Ross

I think you're looking for the 'user' option of qstat. qstat -u username lists all jobs belonging to the given user. Wildcards can be included with a backslash: qstat -u \* lists all jobs.

To answer your specific question (total jobs), you can use wc to count the lines that qstat outputs:

qstat -u username | wc -l

But that will give two more than the actual jobs because qstat has two header lines. So the full command you may want is:

expr $(qstat -u username | wc -l) - 2

Which asks for the jobs by user username, counts the numbers of lines, and subtracts 2.

Похожие вопросы