[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: need help on shell programming

i dont think that script with an eternal loop is the best ideia. If u want keep  this script running for a long time ( even when ur user is loged out, u will need a screen desatached [ screen ^a  ^d]).  My advice will be that u make this script and set a rule at ur crontab for every min:

#crontab -e

(put this line if u need taht script to run every min)
* *  * *   *      ./path/script

hope that helps u,

2009/3/1 Olaf Reitmaier Veracierta <olafrv@gmail.com>
while [ 1 -eq 1 ]; then
  sleep 60

Boyd Stephen Smith Jr. wrote:
On Thursday 26 February 2009 18:35:01 Mike Castle wrote:
On Thu, Feb 26, 2009 at 4:29 PM, Michael Pobega <pobega@gmail.com> wrote:
On Thu, Feb 26, 2009 at 04:54:28PM -0500, Long Wind wrote:
I want a script.
The script run a command, wait one minute,
then run the command again, wait one minute again
... again and again ...
Sounds like a job for Cron!
It depends on how long the job takes, and what the requirements are.

They did seem to imply they want to wait 60 seconds between the end of
one run to the start of the next one, as opposed to running every 60
seconds regardless.

The OP says they want fixed-delay.  Cron is for fixed-frequency.  A script that schedules itself as an "at" job as it's last command is another way to handle fixed-delay.

If the job takes 45 seconds, it could be a pretty substantial semantic


  "You don't know where your shadow will fall",
 Ing. Olaf Reitmaier Veracierta <olafrv@gmail.com>
 http://olafrv.googlepages.com (Personal Webpage)
 http://olafrv.blogspot.com (Technical Blog)

To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Raphael Ottoni S M de Faria

There is no spoon...

Reply to: