killing and relaunching a task every 15 minutes while a script is running


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting killing and relaunching a task every 15 minutes while a script is running
# 1  
Old 11-16-2006
How can I kill and relaunch a task every 15 minutes while a script is running?

Hi there,

I would like to write a script which while running will kill and then execute again a task every 15 minutes.

Here's what I want to do:

Al Jazeera English have a low quality, time-limited 15 minute trial stream up at their site. I.e. when I click on the 56K link, it will play in Real player for Linux (which I have installed on Ubuntu 6.10) but after 15 minutes it will stop playing. At that point I can press play again and it wll again play for another 15 minutes. I am trying to write a script that will:
- curl the .smil file from http://europe.real.com/smil/aljazeera_us_lo.smil
- launch realplayer and play that .smil file
- after 15 minutes, kill realplayer, curl the .smil file again (because due to round robin load distribution I might get on to another server that way, which I want to happen, in order to be a well-behaved user and not to hurt al Jazeera) and then launch realplayer again and play that new .smil file.
- lather, rinse, repeat

I do not want this to happen all of the time (while my computer is booted up), but rather I only want this to happen on demand, e.g. for as long as a certain script is running.

I have looked at cron, but I could not figure out how to do the above. Cron appears to be designed to do stuff at fixed times while the machine is running.

I would be very grateful for any help or suggestions.

Thanks and regards,
ropers

Last edited by ropers; 11-16-2006 at 03:26 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Killing the process if running for long time in script

I am running a script which will read the data from fail line by line and call the Java program by providing the arguments from the each line. The Java code is working fast for few records and for some records its getting hanged not providing response for morethan one hour. Currently am... (4 Replies)
Discussion started by: dineshaila
4 Replies

2. Shell Programming and Scripting

Killing a bash process and running the second part of script

I want to run a script that calls remote ssh and if it gets hung, I want to be able to kill that part of the script and run another command in the script for example I have a statement like this: if ]; then export tapes=$(for tape in $(su - nacct -c 'ssh remote1 "cat... (1 Reply)
Discussion started by: newbie2010
1 Replies

3. Shell Programming and Scripting

A script that kills previous instances of itself upon running not killing child processes

I'm likely going to explain this clumsily, so apologies in advance: I have the following script: #!/bin/bash pidPrefix="logGen" checkPrime () { if /sbin/ifconfig eth0:0|/bin/grep -wq inet;then isPrime=1;else isPrime=0;fi } killScript () { /usr/bin/find /var/run -name... (4 Replies)
Discussion started by: DeCoTwc
4 Replies

4. UNIX for Dummies Questions & Answers

Help with killing / running ( minecraft )

alright, i have been trying to kill a process for some time now and im having a hard time to close it. im not sure if anyone on here is familiar with Minecraft, but im running a server from LimestoneNetworks, i had one of my friends set it up since im not as good as he is with linux, he tryed... (13 Replies)
Discussion started by: tWkiLler96
13 Replies

5. UNIX for Dummies Questions & Answers

Killing a process which is running in different server

Consider two servers tst01 and tst02. i need to log in tst01 and check for the processes which run in tst02. then based on pid , i need to kill that process. is it possible to achieve? I am able to connect to tst02 using ftp. But the problem is, if i use ps it says invalid command. ... (3 Replies)
Discussion started by: pandeesh
3 Replies

6. Shell Programming and Scripting

Running the calling script/task as per day

Hello all.. i have few task to do on specific day ar per weekday or weekend... for example i have 3 tasks: task1 task2 task3 Now i need to create a shell script If it is weekday it will change the status of these tasks as below sendevent -E CHANGE_STATUS -s SUCCESS -J task1... (4 Replies)
Discussion started by: j_panky
4 Replies

7. Shell Programming and Scripting

Killing of a process and send a mail if the process doesnot come up within 2 minutes

Hi Friends, I am new to this forum as well as new to shell scripting. I have a problem here and i need someone to solve this. Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument . There is a... (1 Reply)
Discussion started by: Prince89
1 Replies

8. Shell Programming and Scripting

Leaving Program running but killing the script

Sorry for all the threads. I am almost done. I ahve a bash script that is launching a diags program then copying the .html over my client. then it does the following line /opt/firefox/firefox report.html it launches it fines but the program waits for me to close the window or kill the script.... (2 Replies)
Discussion started by: deaconf19
2 Replies

9. Shell Programming and Scripting

script to kill rsh processes running for more than 10 minutes

Hi Friends, I need to write a script to kill some processes running for more than 10 minutes. Can I get some pointers on that. Thanks for ur help in Advance. Thanks&Regards, Amit (1 Reply)
Discussion started by: amitsayshii
1 Replies

10. UNIX for Advanced & Expert Users

script to kill rsh processes running for more than 10 minutes

Hi Friends, I need to write a script to kill some processes running for more than 10 minutes. Can I get some pointers on that. Thanks for ur help in Advance. Thanks&Regards, Amit (1 Reply)
Discussion started by: amitsayshii
1 Replies
Login or Register to Ask a Question