Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
I have some programs that run FTP scripts to drop off and pick up some files to/from a LINUX server. Suddenly, they (vendor who hosts server) have said they're shutting off FTP and want me to use SFTP (port 22) instead. In my scripts, I don't even specify a port (only an IP address), but I guess it's defaulting to port 21 (?). Anyway, here are a couple examples of simple FTP scripts currently running happily (they are run by CL and RPG programs). What do I need to do in order to have them use SFTP instead? I don't suppose it's as easy as adding :22 to the end of the IP address...?
This one gets a list of files to pick up:
OPEN 'xx.xxx.xxx.xx'
USER myftpuser myftppwd
ASCII
Namefmt 1
SENDEPSV 0
LS (Disk
CLOSE
QUIT
This one picks up a file:
OPEN 'xx.xxx.xxx.xx'
USER myftpuser myftppwd
ASCII
Namefmt 1
SENDEPSV 0
lcd /ecommerce/inbound
GET myfile.csv
RENAME myfile.csv myfile.old
CLOSE
QUIT
This one drops off a file:
OPEN 'xx.xxx.xxx.xx'
USER myftpuser myftppwd
Namefmt 1
SENDEPSV 0
lcd /ecommerce/outbound
MPUT shipments*.csv
CLOSE
QUIT
They just notified me today and want to make the change today... yikes.
Thanks.
The PORT arguement is on the FTP CL command. FTP RMTSYS(xxxxx) PORT(22)
For SSH FTP (vs SSL FTP) you may want to read this article in IBM Systems Mag.