On Sun, Mar 08, 2009 at 08:50:25PM +0100, Michael Wagner wrote:
> -+
> #! /bin/bash |
> |
> if [ $(pgrep -x script.sh) ]; then
On Sun, Mar 08, 2009 at 08:50:25PM +0100, Michael Wagner wrote:
> * Michael Pobega 08.03.2009
>
> > #! /bin/sh
> >
> > if [ $(ps aux | grep script.sh | grep -v grep) ]; then
> >
>
> Hello Michael,
>
> what about "pgrep"?
>
> -+
> #! /bin/
* Michael Pobega 08.03.2009
> #! /bin/sh
>
> if [ $(ps aux | grep script.sh | grep -v grep) ]; then
>
Hello Michael,
what about "pgrep"?
-+
#! /bin/bash |
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 ...
>
> Thanks!
>
Just to bring this back up, you can use a mix of shell programming and
Cronjobs.
Why is it not the 'best' idea? Infinite loops can be used to your
advantage. It's already been remarked that cron will not work because it
is fixed-frequency. That means OP will have to start maintaining state
via files to avoid race conditions.
An infinite while;do;done construct can be inter
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
On Sun, Mar 01, 2009 at 01:32:32AM -0430, Olaf Reitmaier Veracierta wrote:
> Sorry mismatch "then" with "do"...
>
> while [ 1 -eq 1 ]; do
Useless use of test. Use 'true' or ':' instead.
You can save a few cycles (mostly of parsing, I guess :-) [1]
>
>sleep 60
> done
[1] http://xkcd.com/
Sorry mismatch "then" with "do"...
while [ 1 -eq 1 ]; do
sleep 60
done
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 wrote:
On Thu, Feb 26, 2009 at 04:54:28PM -0500, Long Wind wrote:
I want a scr
while [ 1 -eq 1 ]; then
sleep 60
done
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 wrote:
On Thu, Feb 26, 2009 at 04:54:28PM -0500, Long Wind wrote:
I want a script.
The script run a command, wai
On Thursday 26 February 2009 18:35:01 Mike Castle wrote:
> On Thu, Feb 26, 2009 at 4:29 PM, Michael Pobega 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 ag
On Thu, Feb 26, 2009 at 11:01:37PM +0100, Sjors Gielen wrote:
> Kumar Appaiah schreef:
>> On Thu, Feb 26, 2009 at 3:54 PM, 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 ...
>>
>> wh
On Thu, Feb 26, 2009 at 4:29 PM, Michael Pobega 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 ...
>>
>> Thanks!
>>
>>
>
> Sounds like
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 ...
>
> Thanks!
>
>
Sounds like a job for Cron!
--
http://pobega.wordpress.com
On Thu, Feb 26, 2009 at 4:01 PM, Tzafrir Cohen wrote:
>> while [[ 1 < 2 ]]; do echo Hello; sleep 60;done
>
> Not only bashism, but also not as readable.
>
>>
>> Replace "echo Hello" with your command.
>
>
> #!/bin/sh
> while true
> do
> your command
> sleep 60
> done
Thanks for the improved one
Kumar Appaiah schreef:
On Thu, Feb 26, 2009 at 3:54 PM, 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 ...
while [[ 1 < 2 ]]; do echo Hello; sleep 60;done
[[ 1 < 2 ]] ? My suggestion:
while
On Thu, Feb 26, 2009 at 03:56:54PM -0600, Kumar Appaiah wrote:
> On Thu, Feb 26, 2009 at 3:54 PM, 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 ...
>
> while [[ 1 < 2 ]]; do echo H
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 ...
Look at the "watch" package/program.
signature.asc
Description: Digital signature
Thank you very much!
On 2/26/09, Kumar Appaiah wrote:
> On Thu, Feb 26, 2009 at 3:54 PM, 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 ...
>
>
> while [[ 1 < 2 ]]; do echo Hel
On Thu, Feb 26, 2009 at 3:54 PM, 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 ...
while [[ 1 < 2 ]]; do echo Hello; sleep 60;done
Replace "echo Hello" with your command.
HTH.
Kumar
--
19 matches
Mail list logo