Programming :: Running Program In Background From Script

Mar 27, 2011

I have a script that calls another program/script, xxx, to run in the background. Supposedly this program at most should finish within five (5) minutes so after five (5) minutes, I run some other steps to run the script into completion. My problem is sometimes the program takes longer than five (5) minutes and this is causing problems when running the rest of the steps in the scripts. Can anyone suggest how to re-program my script. At the moment, the KSH script, i.e. test.ksh, is doing as below:

test.ksh:
.....
.....
xxx/xxx.ksh <--- program/script called by the script
sleep 300
..... run the rest of the script .....
..... problem is sometimes xxx/xxx.ksh takes longer than 300 seconds .....
..... any way that I can monitor that xxx/xxx.ksh finishes before I run .....
..... the rest of the scripts .....

View 3 Replies


ADVERTISEMENT

General :: Running Program In Background In Child Emulator Process

Aug 26, 2009

I wonder how one can, if at all, run an X program in the background *in an emulator sub-shell process*. What I mean is to launch a program in an emulator, e.g, by xterm -e gedit

but with gedit (in this example) running in the background from inside the xterm sub-process, so that the xterm will accept other commands. In the above, gedit will run in the foreground, and of course, if you do
xterm -e gedit &

then xterm will run in the background, not gedit.In short, I would like to achieve the same thing as "gedit &" as you manually do in xterm, but from another shell. What I aim to do is write an X init script to achieve this result (to have the emulator open and a program or two running from it, in the background, at the X startup).

View 2 Replies View Related

Programming :: Getting Return Value From Program Ran In Background?

Mar 10, 2010

I think my title pretty much explains it. I am writing a script and I want to start a program in the background, and when that program finishes I want to check the return value to make sure there was no error.For example normal I would do something like this:

#!/bin/sh
program
if [ ! $? -eq 0 ]; then
echo "There was an error"
exit 1
fi

Now I want to do something like this:

#!/bin/sh
PRTN=`program1 &`
program2
if [ ! $? -eq 0 ]; then

[code]....

In this case if program2 finishes before program1, I don't think the return value from program1 $PRTN would be valid at the time it is checked.

View 3 Replies View Related

Programming :: Continue Execution Of A Python Program While A Background Task Is Going On?

Aug 28, 2010

I'm trying to figure out how to continue execution of a Python program while a background task is going on.

In bash, it is adding "&" to the end as in:

Code:
#! /bin/bash
find / -iname "*.py" > /tmp/all_pys &
echo "looking for all python scripts and putting them in /tmp/all_pys"
(yes, I know I could just put the echo BEFORE the find but I just use it for example)

Say I do that in python (not necessarily running the shell, but perhaps using scriptutil.ffind or something similar), but want to allow the user to be doing something else while running that search in the background, how would I thread, fork, subprocess (not to be confused with the module and Popen) [or whatever I should call it] that?

View 14 Replies View Related

Programming :: Capturing The Exit Status Of The Script Running In Background

Apr 10, 2010

I have a scenario where I am executing some child shell scripts in background (using &)through a master parent script.

Is there a way I can capture the exit status of each individual child script after the execution is completed.

View 7 Replies View Related

Programming :: Getting A Snapshot Of A Running Program?

Nov 17, 2008

I am trying to use perl to run a program using the eval command but the program runs infinitely, i just need it to run basically for one second, stop then give me the output. I tried using fork but it does not really work. The child process is not being killed.

my $pid = fork;
if ($pid == 0) {
my $results = `ngrep etc...`;

[code]...

View 6 Replies View Related

Programming :: Running C Graphics Program?

Sep 18, 2010

i want to run c graphics program on linux for that i want to install[URL]but i dont know how to install this graphic file on linux to make it un.

View 1 Replies View Related

Programming :: Detect Pipe From Running C Program?

Jan 24, 2009

I'm looking for a way to detect whether or not a program has been called from pipe, e.g.

Code:

whatever | my_program
versus simply just being exectuated directly:

Code:

my_program

Why? In the first case, I want to run the program non-interactively, and in the latter case I want to print out user-friendly messages. I've been thinking along the lines of some check I haven't yet found, like:

Code:

if( stream_buffer_is_not_empty() )
print_interactive_messages();

View 1 Replies View Related

Programming :: Possible To Know The Amount Of Memory Used By A Program Before Running It?

Mar 3, 2009

I would like to know if there is a linux command to verify the amount of memory used by a program. The programs I am using were compiled with gfortran.

View 2 Replies View Related

Programming :: Running External Program On Same Processor?

Mar 2, 2010

The situation is that I have an MPI-parallel fortran program. I run it and it's distributed on N processors, and each of these processes must call an external program.

This external program is also an MPI program, however I want to run it in serial, on the processor that is calling it, as if it were part of the fortran program. The fortran program waits until the external program has completed, and then continues.

The problem is that this external program seems to run on any processor, and not necessarily the (now idle) processor that called it.

how I can call the program and ensure it runs only on this processor?

Extra information that might be helpful:

If I simply run the external program from the command line (ie, type "/path/myprogram.ex <enter>"), it runs fine. If I run it within the fortran program by calling it via

CALL SYSTEM("/path/myprogram.ex")

it doesn't run at all (doesn't even start) and everything crashes. I don't know why this is.

If I call it using mpiexec:

CALL SYSTEM("mpiexec -n 1 /path/myprogram.ex")

then it does work, but I get the problem that it can go on any node.

View 2 Replies View Related

Programming :: Script To Test If Program Is Running

Sep 22, 2010

I'm trying to test whether wget is working still or not. While [ wget is still running ] <----- but how should this look please?
do
codes
done

View 4 Replies View Related

Programming :: Running A Program With Arguments Using A Shell Script

Jul 14, 2011

Running a program with arguments using a shell script

View 1 Replies View Related

Programming :: Sending Keystrokes From C Program To Certain Running Applications?

Jan 13, 2010

My requirement is to save files before shutting the Linux machine down, unattended ie: when the user is not near the machine. This is done whenever the UPS battery is about to die, so that the files get saved. open-Office/text-editor applications that can be saved using keystrokes will have to be found from the running processes and keystrokes should be sent to them from a C program that was started in non-graphics stage. ie: from a C program that forks into memory as a daemon before xwindows part starts. How to I send keystrokes to a running application? (like cotrol + F and then wait and then send next set of keystrokes till the file is saved as a new file or as the same file itself), either from C program or a script?

View 1 Replies View Related

Debian Programming :: Memory Usage When Running Java Program

Jun 28, 2013

I have a java program that runs on Debian as a background processor. Yesterday the Java program stopped running. I looked at the memory usage, the system only had 5MB memory left, so my guess is that the java program ran out of memory to use.

However, after we restarted the java program, we could see that the free memory count started to go up. It kept going up from 5MB to over 400MB. The increase of memory happened slowly, when I measured it, I could see that with each minute passing by, there were a bit more memory added into the free memory pool, and meanwhile, the java background process was running.

I wonder why this would ever happen. It's as if our java program first brought the machine done because it consumed all the memories, then after restart, it starts to give back memories.

View 2 Replies View Related

Ubuntu :: Run Program In Background?

Jan 17, 2011

I frequently run teamviewer on my netbook because it's my favorite remote desktop application, but it doesn't have an option to run at startup nor hidden. This is what I need:o be able to run teamviewer automatically at startup, hidden as a "service?" (meaning no taskbar button nor tray icon) and with a delay of 20 seconds (it has to be started after my wifi has automatically connected, not before).Can't be so hard, but I don't seem to be able to find a good answer to this in Google.

View 4 Replies View Related

General :: Alias To Run A Program In The Background?

Mar 4, 2011

I'm running Utorrent server and I figure I would create an alias to launch the program and run it in the background.alias utorrent='/home/user1/software/utorrent-server-3.0/utserver &'It seems to run the program but the associated webui program is flaky and won't start correctly.If I manually go to the specified path and run the command ./utserver & , I never seem to have an issue with the webui.I was wondering if this could possibly have anything to do with using the '&' ampersand operator in an alias.

View 2 Replies View Related

General :: Why Does Running A Program In Bash Work, When Running It In The Menu Doesn't?

Jul 26, 2010

I presume there is something in the JWM window manager - or Puppy Linux Lupu 5.01 itself that is conflicting with the normal loading of GMPLAYER....

I would like to know how to troubleshoot, and fix this problem if possible (even a workaround would be great).

View 1 Replies View Related

Ubuntu :: Apt-Get Always Running In Background

Mar 7, 2011

Every day I use the top command to check the processes running on my Kubuntu 10.10 system. Every day I find that apt-get is running under the root account and using 100% of the CPU. It'll run forever if I let it but I use "killall" to stop it. Pressing the "c" key in top shows the command used to start the process and doing that I see that apt-get is being started with "apt-get -qq -y update". The -qq param is for quiet mode and the -y is to answer yes to any questions. The important thing is the update parameter. It seems that some "feature" of Ubuntu is starting apt-get in update mode for me on a daily basis. I installed Kubuntu only 3 days ago and I don't recall turning this "feature" on anywhere. How can I disable this "feature" and prevent the system from auto-starting apt-get.?

View 3 Replies View Related

Fedora :: Something's Always Running In Background?

Mar 3, 2010

Now whenever I turn on the computer, there would be a Fedora "circle" non-stopping. How can I stop it?

View 1 Replies View Related

General :: Running Php In The Background?

May 31, 2010

I have a LAMP server with some php files. When I do this:

> php -f filename.php

It works great. But of course, it stops when I close the SSH window. I need to be able to run it and leave it running. The script is a crawler and it takes about 3 hours to complete it. So I tried this:

> php -f filename.php &

This doesn't work at all. It doesn't even execute the script.

View 10 Replies View Related

Debian Configuration :: Best Way To See What Is Running In The Background

Nov 3, 2010

I am running a dual-boot of LMDE and Debian Squeeze XFCE, and I actually have a Debian XFCE question. How can I tell what is running in the background. I have been tweaking my Debian install since I first installed it about 3 weeks ago, and I keep adding to the RAM usage. What is the best way to see what else is running out there and whether or not is it necessary?

View 5 Replies View Related

Ubuntu :: Terminal Running In Background - Put More?

May 13, 2011

Ive got my webserver linked up to my ubuntu computer, and i want it to act like a server controller (for srcds games or w/e) Basically, When i click the start button, the SSH launches 'css.sh' by doing this 'sh css.sh'... Anyway, the .sh file has this inside it cd sourceds/srcds_1/orangebox clear ./srcds_run -console -game cstrike +map de_dust -maxplayers 16 -autoupdate

But either way, that is becides the point. When it launches i dont see the terminal window, its invisible.... (but its running) How do i see it when i go to my ubuntu desktop and how to i put more commands in it once its launched in the background.

View 3 Replies View Related

Red Hat / Fedora :: Running Konqueror In Background?

Jun 18, 2010

In a script that I run manually after I have logged in, I have the following:alias kq='konqueror &' The intention is to run konqueror in the background. What happens is as follows. A. I run kq; it starts konqueror but does not return to the command prompt. I quit konqueror. B. I run kq again ; it starts konqueror and this time I get a the command prompt. If I quit konqueror and run kq for a 3rd time it behaves as in A. Quit and run it behaves as in B, and so on..

View 3 Replies View Related

SUSE :: Running Scripts In Background ?

Feb 28, 2009

I have written a script, lets call it B, that calls scripts A1 to A9. I want to run the A scripts simultaneously since they can take up to 3 hrs to complete. As you might expect, I use the & to run the script in background. I am looking for a mechanism to evaluate the return code from the A scripts when they eventually complete?

View 2 Replies View Related

General :: Way To See Only Process Running In Background?

Feb 23, 2011

Is there some way to see only the process running in the background?

View 4 Replies View Related

General :: Running Process In Background

Jan 14, 2011

Is there any way to run a long process in background so that it still remain in running state even if the user logout the system.

View 12 Replies View Related

General :: How To Keep Script Running In Background

Mar 1, 2010

If I wanted to run a script in the background and keep it running even if I close putty I do like
./perl.pl &
right?

View 4 Replies View Related

Software :: Running A Tcpdump In The Background ?

Nov 8, 2010

When attempting to run a tcdump in the background (IPSO) with the following command:

I get the message:

However the command runs fine without the '&' at the end of the line are there syntax restrictions in using the '&' flag?

View 2 Replies View Related

General :: Move Running Process To Background

Mar 10, 2011

How do you move a running process to the background? For example, type the command sleep 60 on the command line and try moving that process to the background.

View 1 Replies View Related

Ubuntu :: Firefox Constantly Running On The Background?

Mar 23, 2010

I'm running Ultimate Edition 2.0 64bit. When I'm running Firefox and I'm not doing anything on it it starts to use the disk intensively. I checked on terminal using the top command and it IS Firefox using up to 85-90% of the resources. Anyone know what the problem is here? Can it be hacked? I already uninstalled and installed back again and it still doing it.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved