HELP: Exiting a non ending program inside a shell to run it again with different arguments...

HELP: Exiting a non ending program inside a shell to run it again with different arguments...

Post by JJ » Thu, 19 Apr 2001 23:38:00



Hi,

I want to write a shell script that runs a disk stress program...

the stress program has a command line argument like this:

./stress rs /dev/disk1 /dev/disk2 65536 100 0

The stress program has no exit conditions...

I want to run it for 5 minutes or so and then run a different file
size:
./stress rs /dev/disk1 /dev/disk2 16384 100 0

Is there a way to send a ctrl-c or break when the program is running
or before the program to go in 5 minutes?

I want to run this stress program like 15 times, so sitting at the
term is not an option for 75 minutes.

Any ideas appreciated.

 
 
 

HELP: Exiting a non ending program inside a shell to run it again with different arguments...

Post by Benjamin.Altma » Fri, 20 Apr 2001 00:10:32


You would want something like:
    for val in 65536 16384; do
        ./stress rs /dev/disk1 /dev/disk2 $val 100 0 &
        sleep 300
        kill $!
    done

You would place all 15 different values in the for loop to run 15 times
every 5 minutes.
Ben


> Hi,

> I want to write a shell script that runs a disk stress program...

> the stress program has a command line argument like this:

> ./stress rs /dev/disk1 /dev/disk2 65536 100 0

> The stress program has no exit conditions...

> I want to run it for 5 minutes or so and then run a different file
> size:
> ./stress rs /dev/disk1 /dev/disk2 16384 100 0

> Is there a way to send a ctrl-c or break when the program is running
> or before the program to go in 5 minutes?

> I want to run this stress program like 15 times, so sitting at the
> term is not an option for 75 minutes.

> Any ideas appreciated.


 
 
 

HELP: Exiting a non ending program inside a shell to run it again with different arguments...

Post by JJ » Fri, 20 Apr 2001 02:26:31


Perfect, just what I was looking for..thank you!

On Wed, 18 Apr 2001 11:10:32 -0400, "Benjamin.Altman"


>You would want something like:
>    for val in 65536 16384; do
>        ./stress rs /dev/disk1 /dev/disk2 $val 100 0 &
>        sleep 300
>        kill $!
>    done

>You would place all 15 different values in the for loop to run 15 times
>every 5 minutes.
>Ben


>> Hi,

>> I want to write a shell script that runs a disk stress program...

>> the stress program has a command line argument like this:

>> ./stress rs /dev/disk1 /dev/disk2 65536 100 0

>> The stress program has no exit conditions...

>> I want to run it for 5 minutes or so and then run a different file
>> size:
>> ./stress rs /dev/disk1 /dev/disk2 16384 100 0

>> Is there a way to send a ctrl-c or break when the program is running
>> or before the program to go in 5 minutes?

>> I want to run this stress program like 15 times, so sitting at the
>> term is not an option for 75 minutes.

>> Any ideas appreciated.