Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say if I need to run a command checkstatus --jobnumber 12345 to check the job status. The command prints out the info to standard output. Is there any way to run this command on shell repeatedly every minute? I wanted to see the latest job status.

share|improve this question
why you dont wan't to use crontab? – Alan Kuras Mar 7 '12 at 6:02
I think the idea is to run it in the foreground. crontab would run the command in the background, and even if it could run it in the foreground it'd be overkill, IMHO. This is exactly what watch is for. – Will Apr 29 at 20:26
up vote 9 down vote accepted

Also watch(1)

share|improve this answer
this is the best way imho. watch -n 60 'command to run' – Sirex Mar 7 '12 at 7:46

Here's a small bashscript that would do that:


while : 
        checkstatus --jobnumber 12345;
        sleep 60;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.