Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-22-2006, 09:32 PM   #1
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Rep: Reputation: 30
How to re-run a command every x seconds automatically?

Suppose I want this command

# cat /proc/mdstat

to run every 2 sec automatically and repetitively, what is the command that must precede the cat command?

*not using cron

Old 08-22-2006, 09:34 PM   #2
Senior Member
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
kinda the whole idea behind cron, reason you're not using it?
Old 08-22-2006, 09:35 PM   #3
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 167Reputation: 167
Does this do what you want?
watch -n 2 cat /proc/mdstat
Old 08-22-2006, 09:49 PM   #4
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Original Poster
Rep: Reputation: 30
Thanks ! That's the command I'm looking for.

Originally Posted by gilead
Does this do what you want?
watch -n 2 cat /proc/mdstat
Old 08-22-2006, 10:58 PM   #5
LQ Newbie
Registered: Jul 2006
Location: Minnesota
Distribution: RHEL, Debian, Ubuntu
Posts: 27

Rep: Reputation: 15
It's also possible to run mdadm in daemon mode to report any issues with your devices to you.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Command on boot automatically qqcoisa Linux - Hardware 1 03-20-2006 12:27 AM
How can a command/program be run automatically on boot? chuanweizuo Linux - Hardware 1 11-28-2005 10:36 AM
How to run a command automatically on start up TKD SUSE / openSUSE 6 11-03-2005 04:41 AM
How can I run a command automatically at startup? luwigie Linux - General 8 08-26-2004 09:05 PM
How do I get Fedora to automatically run a command during startup? jlsain Linux - Software 2 03-23-2004 04:03 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration