Bash/SH help

Any help topics that don't fit in the current categories can go here.
Post Reply
User avatar
FrederickGeek8
Posts: 148
Joined: Wed Nov 30, 2011 10:31 pm

Bash/SH help

Post by FrederickGeek8 »

How to I write a script that runs another script and restarts that script every 30 seconds?

So what I am looking for
[syntax=text]script_1 ->runs-> script_2;
script_1 ->lets run for 30 seconds-> script_2;
script_1 ->kills-> script_2;
repeat;[/syntax]
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bash/SH help

Post by jacek »

You are after an infinite loop of executions every 30 seconds ?

[syntax=text]#!/bin/bash

while true
do

echo "Just keep running..."

sleep 30

done

exit 0[/syntax]

You could call another script using bash

[syntax=text]bash file_name.sh[/syntax]
hope that helps :)
Image
Post Reply