running a 5-10min SW on the server and use the result right after


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting running a 5-10min SW on the server and use the result right after
# 1  
Old 03-02-2011
running a 5-10min SW on the server and use the result right after

Hi everyone, thanks in advance for your kind help!

Here is what i need to achieve (simplificated example of course):

1-i have a "300-hour-music.mp3" file in my server HD side
2-a page HTML/PHP gets user input : the length of the track he want to listen, let's say 2 hours
3-a BASH script take the "300-hour-music.mp3" file and make a custom "custom.mp3" 2h music file (the BASH script may require 2-10 minutes to run fully...)
4-a page HTML/PHP gets the result "custom.mp3" and send it through a WEB stream player plugin


i have the "300-hour-music.mp3", BASH script, few ideas for user input gathering


I'm a bit skilled in linux scripting, I'm 100% new to PHP coding, WEB interfacing, etc...


How do i get php code to make something like this happen on the server HD:

====================================================
DIR=/server-static-home/music/temp/$RANDOM/
mkdir $DIR
cd $DIR

execute "../../bin/BASH-script-PART1.sh 2h " & // in background
# the BASH-script-part1.sh is killed after 30s --> php.ini timeout and i cannot change it!
# BUT the script started the sub processes ./sox still running on the server, which is goood!!

#check processes completion & wait : can take up to 5-10min !!!
while ("ps -ef | grep sox | grep combine | grep -v grep" != "") do sleep 5s / refresh page ?;


# now file "$DIR/custom.mp3" should exist

execute plugin WEB-player $DIR/custom.mp3

====================================================

Q : should i build a self-refreshing page with PHP ? because if i loop sleep command for > 1min the browser thinks connection out!

Q : do i have it all wrong ? is PHP the correct WEB inferface for what i need to do ?
--> any suggestion like use html, perl, asp ?

launch command exec("script") // the browser will wait until script completion
launch("start-web-player file.mp3") // all done!! easy
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare the current result with previous line result.?

Hi Gurus, I have requirement to compare current result with previous reuslt. The sample case is below. 1 job1 1 1 job2 2 1 job3 3 2 job_a1 1 2 job_a2 2 2 job_a3 3 3 job_b1 1 3 job_b2 2 for above sample file, GID is group ID, for input line, the job run... (1 Reply)
Discussion started by: ken6503
1 Replies

2. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

3. Shell Programming and Scripting

Problem connect to a different server then do sudo login and finally run some scripts and get result

I have to write a shell script in my current linux server and I have to connect to a different server then do sudo login and finally run some scripts residing in a particular directory and get results back. I am starting to write my shell script as below but after I do ssh login it prompts for... (2 Replies)
Discussion started by: Devesh5683
2 Replies

4. UNIX for Dummies Questions & Answers

Transfer file from server B to server C and running the script on server A

I have 3 servers A, B, C and server B is having some files in /u01/soa/ directory, these files i want to copy to server C, and i want to run the script from server A. Script(Server A) --> Files at Server B (Source server) --> Copy the files to Server C(Target Server). We dont have RSA key... (4 Replies)
Discussion started by: kiran_j
4 Replies

5. Solaris

Test program running taking much more time on high end server T5440 than low end server T5220

Hi all, I have written the following program and run on both T5440 and T5220 on same OS version. I found that T5540 server takes more time than T5220. Please find below the details. test1.cpp #include <iostream> #include <pthread.h> using namespace std; #define NUM_OF_THREADS 20... (17 Replies)
Discussion started by: sanjay_singh85
17 Replies

6. UNIX for Dummies Questions & Answers

search history without result running automatically

Hi I want to search the history of commands. for the last use of eg.$ service httpd reload $history = brings up the full list $!serv = runs service httpd reload, if thast was the last command used with the string $!?serv? = does the same as above I do not want to run the command... (1 Reply)
Discussion started by: dunsta
1 Replies

7. Shell Programming and Scripting

Using SED/AWK to Summarize Log File in 10min Intervals

I have this huge log file on my linux box that gets generated every day. I'm able to extract the information I need; however I really would like it to be broken down every 10mins. Log File Snippet 01:23:45 MARYHADA Maryhadalittle.lamb(): fleece as white as snow 1394 for and everywhere that... (8 Replies)
Discussion started by: ravzter
8 Replies

8. Shell Programming and Scripting

Running a script in a server from another server

Hi Guys Say I have two servers (A & B) and two scripts (script1 & script2). script1 will be running on server A and script2 will nbe running on server B. Now my need is to kickoff script2 (in server B) just after finishing running script1 (in server A) Any idea, how to achieve this?... (2 Replies)
Discussion started by: csaha
2 Replies

9. UNIX for Dummies Questions & Answers

X-server not currently running.

Hi guys sorry if I offend anyone with my simple question but i just isntalled Red hat in my oc and I'm tryung to isntall the video card's drivers, i got the rpm and the drivers itself to do this. On the RPM INSTRUCTIONS the first thing that appears is "Ensure the X-server is not... (3 Replies)
Discussion started by: cherupop
3 Replies

10. Shell Programming and Scripting

running 2 shell jobs while waitting for result

Hi, i'm trying to run from 3rd party program that runs RShell and waits for the job to be finished with a result / return code. the problem is that my shell job is starting another shell job, and when the secound job is starting, the first is finished and it returns to the program the first... (2 Replies)
Discussion started by: eyalush
2 Replies
Login or Register to Ask a Question