There's not a way to have it redirect the output to the console.  However, 
you could redirect the stdout output to a file using the STDOUT option on 
the PROCESS START request.  Then you could use tail to periodically view 
the stdout file by submitting another PROCESS START request to run tail on 
the stdout file.  For example:

STAF host1 PROCESS START SHELL "SomeLongScript.sh" WAIT RETURNSTDOUT 
STDERRTOSTDOUT STDOUT /tmp/SomeLongScript.out

STAF host1 PROCESS START SHELL "tail -n 20 /tmp/SomeLongScript.out" WAIT 
RETURNSTDOUT STDERRTOSTDOUT

Or, you could use something else to view the file contents like submitting 
a "STAF host1 FS GET FILE /tmp/SomeLongScript.out" request but if the file 
contents could be very large then you don't want to be getting the entire 
contents of the file as a single string using a FS GET FILE request as 
that will use a lot of memory).

There is a STAF feature request open on SourceForge that would enable this 
to be done in another way (but it is not implemented yet and I don't know 
when we'll have time to do it).  Note that anyone can contribute code to 
the STAF project.  For more information on this open STAF Feature, see 
Feature #523877 "Add open/read/write/close support to FS" at  
http://sourceforge.net/tracker/?func=detail&aid=523877&group_id=33142&atid=407384
.

Note that you can search the STAF forums (select "Search forums" from the 
navigation column on the left of http://staf.sourceforge.net) to search 
for forum entries with say "tail" and you'll see this question asked by 
others and already answered.  For example, see the forum posting titled 
"Retrieving outpu from remote machine" at 
https://sourceforge.net/projects/staf/forums/forum/104046/topic/6892244. 
Other forum posting that talk about this solution include 
https://sourceforge.net/projects/staf/forums/forum/104046/topic/3246048 
and  
https://sourceforge.net/projects/staf/forums/forum/104046/topic/3206662.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   Parag Manjrekar <reachpar...@gmail.com>
To:     staf-users@lists.sourceforge.net, 
Date:   05/09/2013 01:38 AM
Subject:        [staf-users] STAF process command output Vs SSH execution 
output



Is there any mechanism where for some execution of long running scripts 
can 
redirect their stdouts/stderror to the system issuing the command ?

e.g STAF HOST1 PROCESS START SHELL "SomeLongScript.sh" WAIT RETURNSTDOUT 
RETURNSTDERR - showing the the output "as is it" comes to terminal ?

just like you execute via SSH using command
e.g ssh user@HOST1 SomeLongScript.sh


I observe that in case of staf the remote buffer are obtained only when 
command exits. but end user cannot gauge if things are happening fine via 
script.

I can see one way of modifying "SomeLongScript.sh" to generate message in 
form 
of queue to calling machine. But that cannot be feasible all the times.

can some solution like REDIRECT be a solution.
Also if there is any solution already existing, please share as I see lots 
of 
forum seeking for help.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to