Striker has asked for the wisdom of the Perl Monks concerning the following question:
I am working on a web UI using perl CGI. I have to run a script from UI and when it finishes its execution (which takes about one hour) then rename a .png file and then I have to kill some processes. here is what I am doing for it.
system "sudo -E ./top_apps.sh stats.log > dev/null &"; $pid=`sudo -E pgrep top_apps.sh -d "," | xargs echo`; system "sudo -E ./run_test.sh > /dev/null ; mv ./img/stats.log_cpu.png + ./img/stats.log_cpu$stats_no.png ; pkill $pid &;
Now when I am doing just the following
system "sudo -E ./top_apps.sh stats.log > dev/null &"; $pid=`sudo -E pgrep top_apps.sh -d "," | xargs echo`; system "sudo -E ./run_test.sh > /dev/null &;
its working fine but when I am adding commands to rename and kill PIDs web UI is giving error that 'No data Received'. When I am running this command directly from shell its working fine all the processes are going on one after one. Please tell me what is wrong in this or if there is any other method to do tasks one after one in perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Executing next system command one first one is compete
by Anonymous Monk on Mar 27, 2014 at 11:27 UTC | |
|
Re: Executing next system command one first one is compete
by kcott (Archbishop) on Mar 27, 2014 at 16:03 UTC | |
by thargas (Deacon) on Mar 28, 2014 at 15:58 UTC |