RE: Crontab

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

 



As far as I know does the sleep command put the process into
"sleep/disable" mode and awake it after the given timeframe.
	This means there is no waste of CPU cycles during the sleep. The
only waste is the real program doing `while` and script1.sh

Cheers,
Simon

>-----Original Message-----
>From: redhat-list-bounces@xxxxxxxxxx 
>[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Geofrey Rainey
>Sent: Monday, April 20, 2009 10:06 PM
>To: General Red Hat Linux discussion list
>Subject: RE: Crontab
>
>There's a condition known as busy waiting whereby a process
>Loops continuously wasting CPU cycles as opposed to the process
>Going into a wait state.
>I wonder if sleeping a process wastes CPU cycles as described and
>if so is there a better implentation of this?
>
>
>-----Original Message-----
>From: redhat-list-bounces@xxxxxxxxxx
>[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Reber, Simon
>Sent: Monday, 20 April 2009 9:07 p.m.
>To: General Red Hat Linux discussion list
>Subject: RE: Crontab
>
>Instead of doing this,
>Simply build a script that has a content as follow:
>
>while [ true ]
>	do
>	script1.sh
>	sleep 30
>done
>
>It's much simpler and you don't need to run it via cron every minute.
>	But you still can control the script and the start/stop via
>cron.
>
>Cheers,
>Simon
>
>>-----Original Message-----
>>From: redhat-list-bounces@xxxxxxxxxx
>>[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Rohit khaladkar
>>Sent: Monday, April 20, 2009 10:59 AM
>>To: General Red Hat Linux discussion list
>>Subject: Re: Crontab
>>
>>I guess you cannot have crontab entry in terms of seconds.But you can 
>>create a script which would repeatedly run your script and give an 
>>interval of 30 seconds.
>>For eg, create a tmp.sh script which would run your desired 
>script (say
>>script1.sh) after every 30 seconds.
>>
>>Your tmp.sh script would look like
>>
>>#!/bin/sh
>>script1.sh
>>sleep 30
>>script1.sh
>>sleep 30
>>script1.sh
>>
>>
>>Make an entry in the crontab to execute this script every minute.
>>
>>This should solve the purpose. If anyone comes up with a better idea, 
>>feel free to go ahead with that, but this is a workaround, if you are 
>>stuck.
>>
>>Thanks!
>>Rohit Khaladkar.
>>
>>On Mon, Apr 20, 2009 at 2:17 PM, ~~~0Pen ~~~ S0uRce ~~~ 
>><vijay1313@xxxxxxxxx
>>> wrote:
>>
>>> Hi guys,
>>>                     Do any one have  idea that how can i
>>configure crontab
>>> to run a script after every 30 seconds,i know about default
>>parameters of
>>> crontab and tried  google also,but could not find any thing.
>>>
>>> Any suggestion Please !!!!
>>>
>>>
>>>
>>> --
>>> ~~~ 0Pen ~~~ S0uRce ~~~
>>> --
>>> redhat-list mailing list
>>> unsubscribe 
>mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
>>> https://www.redhat.com/mailman/listinfo/redhat-list
>>>
>>--
>>redhat-list mailing list
>>unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
>>https://www.redhat.com/mailman/listinfo/redhat-list
>>
>
>-- 
>redhat-list mailing list
>unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
>https://www.redhat.com/mailman/listinfo/redhat-list
>==========================================================
>For more information on the Television New Zealand Group, visit us
>online at tvnz.co.nz 
>==========================================================
>CAUTION:  This e-mail and any attachment(s) contain information that
>is intended to be read only by the named recipient(s).  This 
>information
>is not to be used or stored by any other person and/or organisation.
>
>
>-- 
>redhat-list mailing list
>unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
>https://www.redhat.com/mailman/listinfo/redhat-list
>

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux