Yes, of course that would be fine. But note that whenever you have more
than one task to perform sequentially within an element that only excepts
one task, you have to enclose the tasks within a <sequence> element, For
example:
<if expr="RC != 0">
<sequence>
<message log="1">'Process failed - RC: %s, Result: %s' % (RC,
STAFResult)</message>
<stafcmd>
<location>'m2'</location>
<service>'FS'</service>
<request>'COPY FILE /sangram/test.log TOFILE
c:/STAF/staf_jobs/test.log'</request>
</stafcmd>
<if expr="RC != 0">
<message log="1">'FS COPY failed - RC: %s, Result: %s' % (RC,
STAFResult)</message>
</if>
</sequence>
</if>
Note: Please post questions to the staf-users mailing list, not just
directly to me.
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
Sangram Bakshi <san...@gmail.com>
03/02/2009 12:46 PM
To
Sharon Lucas/Austin/i...@ibmus
cc
Subject
Re: [staf-users] Copying file from remote machine to user machine.
Hi Sharon,
Thanks a lot for your suggestions.
Also i wanted to call the file copy thing is this sequence , would it be
ok.
1. Stax element to run a command on remote machine .
2. Check if the command is a success ( does it means that the check would
be true only when the command completes successfully, i mean when the task
on the remote machine gets over ), then call the stax element to do the
file copy.
a.<stax element to run a command on a remote machine>
b. <if expr="RC != 0">
<message log="1">'RC: %s, Result: %s' % (RC, STAFResult)</message>
<write here the stax element to copy the file from remote to user
machine>
</if>
I mean to say i want to call the file copy , only when the command run
completely on the remote machine .
Regards
Sangram
On Mon, Mar 2, 2009 at 10:05 PM, Sharon Lucas <luc...@us.ibm.com> wrote:
No, you're not doing it correctly. If you want to copy file
/sangram/test.log from machine m2 to file c:/STAF/staf_jobs/test.log on
machine m1 and you're submitting the FS COPY request from machine m1 (your
STAX service machine), then you would run submit the following FS COPY
request:
STAF m2 COPY FILE /sangram/test.log TOFILE c:/STAF/staf_jobs/test.log
In a <stafcmd> element in a STAX job, this would look like:
<stafcmd>
<location>'m2'</location>
<service>'FS'</service>
<request>'COPY FILE /sangram/test.log TOFILE
c:/STAF/staf_jobs/test.log'</request>
</stafcmd>
You don't need to specify the TOMACHINE option because you want to copy
the file to the machine that is submitting the FS COPY request (e.g. m1).
This is because if your don't specify the TOMACHINE option, it defaults
to copying the file to the machine which orgiinated the FS COPY request
(as documented in section "8.4.2 COPY FILE" in the STAF User's Guide).
But, if for some readon you did specify the TOMACHINE option, you would
specify m1, not m2, since you want tocopy the file to machine m1.
Also, note that TOFILE must be the fully-qualified name of the file to be
copied to (not just the directory where to copy the file as it appeared
you specified) and the directory path specified (e.g. C:/STAF/staf_jobs)
must already exist on the TOMACHINE m1 or else the FS COPY request will
fail with RC 17 (File open error). Or, if you prefer, you can use the
TODIRECTORY option instead of the TOFILE option to specify the name of the
directory where to copy the file to (and the name of the "to file" will be
the same as specified in the FILE option). Again, the directory specified
by the TODIRECTORY option must already exist on the TOMACHINE, m1. An
example of using the TODIRECTORY option instead of the TOFILE option is:
STAF m2 COPY FILE /sangram/test.log TODIRECTORY c:/STAF/staf_jobs
In a <stafcmd> element in a STAX job, this would look like:
<stafcmd>
<location>'m2'</location>
<service>'FS'</service>
<request>'COPY FILE /sangram/test.log TODIRECTORY
c:/STAF/staf_jobs'</request>
</stafcmd>
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
Sangram Bakshi <san...@gmail.com>
03/02/2009 06:29 AM
To
staf-users@lists.sourceforge.net
cc
Subject
[staf-users] Copying file from remote machine to user machine.
Hi,
I want to copy files from a remote machine (m2) to machine (m1). I am
running a stax xml application in machine m1 .
m1 ============== m2
A command is run on machine m2 from machine m1 through the xml . A report
file is created at remote machine m2. I want to get the file from m2 to m1
. How can i write it in the xml .
I would like to do something like :
STAF m2 FS COPY FILE /sangram/test.log TOFILE
c:/STAF/staf_jobs/ TOMACHINE m2
I want to write this is the xml something like this
<stafcmd>
<location>machName</location>
<service>'FS'</service>
<request>'COPY FILE /sangram/test.log TOFILE
c:/STAF/staf_jobs/ TOMACHINE m2'</request>
</stafcmd>
Is this right .Kindly let me know if i am writing the proper thing in the
xml.
Regards
Sangram
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source code:
SFAD
http://p.sf.net/sfu/XcvMzF8H_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users