LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-06-2008, 12:28 AM   #1
babag
Member
 
Registered: Aug 2003
Posts: 365

Rep: Reputation: 30
how to monitor a running script initiated from remote computer


thanks to all who've gotten me this far. i'm now able to ssh in to
a remote computer and start it running a script. here's my issue,
though: the script in question is one which processes still photos
via a command line app. my script loops through a directory doing
things like cropping and resizing the images. as it does each, the
script displays the filename for the file being worked on. i have
been monitoring progress by simply looking at my konsole window
to see what file is up (they're all named the same but each has a
unique number so seeing the number tells me the progress).

when i start this processing script from a remote ssh client, i'll
be doing so from another script on this ssh client computer. i plan
on using an ampersand '&' at the end of the command so the ssh client
script can return to its next command and continue rather than
waiting for the processing script to run through all it's files
first. that means i have no display on the ssh client for the
progress of the processing script. if i go over to the processing
computer and look at the screen, nothing is displayed there either
since it's processing script has been initiated from the outside
and not my usual invocation from the konsole window.

is there a way i can start the processing script via ssh and have
it bring up a konsole window and display itself as if i'd started
it locally?

hope this is clear and thanks again,
BabaG

Last edited by babag; 04-06-2008 at 12:30 AM.
 
Old 04-06-2008, 01:09 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,390
Blog Entries: 2

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
If it isn't already installed, get GNU screen. Run your script in a screen session, and leave it in the foreground. You can detach from the screen session, and re-attach later, even from a different login if you wish. You may even want to configure it in multi-user mode, and connect to a running session as a different user.
--- rod.
 
Old 04-06-2008, 01:47 AM   #3
babag
Member
 
Registered: Aug 2003
Posts: 365

Original Poster
Rep: Reputation: 30
thanks rod.

so, i'd ssh in from a client computer, start a screen session,
start the script inside that screen session? then, because i'm
in a screen session, i'd have more options for displaying the
running script? starting to sound pretty complex. maybe it's
just that this is the first i've ever heard of screen. have
started looking into it. still hoping for something that i
could do without having to use tools i've never used before,
though; ideally, konsole, ssh, and my scripts.

the script is pretty much all this computer does so i really
don't need to be logging in and out of various sessions. all
i really need to do is have the script start and display
itself. once it starts and is visible, it can pretty much
stay there as the only thing on the computer's screen. on the
other hand, if gnu screen is the only or easiest way to do
this, i guess i'll have to figure it out.

is there a way, excluding screen, that if a script is running,
but not displayed because it's been started from a command
from an outside computer, is there a way i can call up a
konsole and display the output of this running script?

thanks again,
BabaG

Last edited by babag; 04-06-2008 at 02:01 AM.
 
Old 04-07-2008, 03:11 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,390
Blog Entries: 2

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
Redirect the script's standard output &/or standard error streams to a file. From any other console:
Code:
tail -f theRedirectedOutputFile
--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program initiated via python's os.system() doesn't work (when in crontab script) itmi Programming 3 03-03-2008 05:36 PM
running script on a remote host p_test Programming 5 10-02-2006 03:40 PM
How do you connect to another computer and use an application running on it remote? zahadumy Linux - Software 8 05-19-2006 04:43 PM
script to monitor process on remote machine kencha Linux - Newbie 6 01-07-2005 12:07 PM
run programs on a remote computer with script, how? cmisip Linux - Networking 5 07-07-2003 01:48 PM


All times are GMT -5. The time now is 06:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration