0

Suppose I have a file called helloworld.txt on an AS400 and I want to write a script to automate the daily upload of the source file helloworld.txt on an AS400 server to upload to a Unix SFTP server, say sftp://exampleunixsftp.com?

Does someone have such a script? Is OpenSSH the only tool that can be used on the AS400 to get this accomplished or are there any other methods? If LFTP could be installed on the AS400, that would be an easy solution but since it's only for Unix/Linux/Win/Mac then I don't have this option. I read Scott Klement's article at: http://systeminetwork.com/article/ssh-scp-and-sftp-tools-openssh

I just need an example basic script to get this done. I'd appreciate this.

user1207994
  • 30
  • 1
  • 7

1 Answers1

3

The MidrangeWiki topic on SSH has some information and examples that may be helpful.

sftp is intended primarily as an interactive utility. scp performs the same function non-interactively.

The command, once authentication is set up, would simply be:

scp helloworld.txt username@exampleunixsftp.com:<destination path>

LFTP can be installed with some preparation in the PASE environment. See Open Source Binaries. Currently offline. Use the Google cache.

James Allman
  • 40,573
  • 11
  • 57
  • 70
  • James, thanks! How would I go about authenticating using SCP? Could you provide an example of how I would setup authentication? – user1207994 Aug 07 '12 at 08:08