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