4

I want to keep monitoring a specific job on a slurm worload like cluster. I tried to use the watch command and grep the specific id. If the job id is4138, I tried

$> watch squeue -u mnyber004 | grep 4138
$> squeue -u mnyber004 | watch grep 4138

but they doesn't work. The second command works for the first few seconds, but stop working when watch refreshes.

A better idea please?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Many
  • 257

2 Answers2

13

You have to quote the command

watch 'squeue -u mnyber004 | grep 4138'
RalfFriedl
  • 8,981
4

The other answer covers how to handle using the 'watch' utility with a pipe but since you're using Slurm and know the job ID, just ask Slurm for that job's status:

$> watch squeue -j 4138