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
script_1 ->runs-> script_2;
script_1 ->lets run for 30 seconds-> script_2;
script_1 ->kills-> script_2;
repeat;
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 ?
#!/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 :)
Image
Post Reply