Page 1 of 1

Bash/SH help

Posted: Tue Dec 11, 2012 3:41 am
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
script_1 ->runs-> script_2;
script_1 ->lets run for 30 seconds-> script_2;
script_1 ->kills-> script_2;
repeat;

Re: Bash/SH help

Posted: Thu Dec 13, 2012 11:34 pm
by jacek
You are after an infinite loop of executions every 30 seconds ?
#!/bin/bash

while true
do
	
	echo "Just keep running..."
	
	sleep 30
	
done

exit 0
You could call another script using bash
bash file_name.sh
hope that helps :)