Jody Craigie wrote:
> Okay, now I have a Public Key and it is working fine, however, I am still unable to issue the SFTP command in
> a batch job. I tried $ SFTP/BATCHFILE=TEST.COM and got an error stating that the /BATCHFILE=TEST.COM is not
> allowed. If I try using SFTP and the commands directly, I get %DCL-W-SKPDAT, image data (records not beginning
> with "$") ignored.
>
> Example of 1st scenario: Command = sub testit.com contents of testit.com = $ SFTP/BATCHFILE=TEST.COM
> $ EXIT
>
> contents of test.com = open username@ip_address
> ascii
> put filename.ext
> exit
>
>
>
> Example of 2nd scenario: Command = sub test.com contents of test.com = $ SFTP
> open username@ip_address
> ascii
> put filename.ext
> exit
> $ EXIT
>
> NOTE: Both cases work if I do it interactively / using "@".
>
>
> What am I missing or is this just not possible?
>



The contents of the batchfile should not have the open
command this information is supplied on the sftp command. For
example create a file called commands.sftp with the following in it -

get file.txt
rm file.txt

Then use sftp as follows -

$ sftp/batch=commands.sftp "user@hostname"

SFTP will connect to hostname and once authenticated issue the
get and rm commands.

regards
Mike

--
+-------------------------------------------------------------------------+
Michael Corbett Email: Corbett@process.com
Process Software Phone: 800 722-7770 x369
959 Concord St. 508 879-6994 x369
Framingham MA 01701-4682 FAX: 508 879-0042