FTP is used mainly to transfer files between systems. You can also use FTP to run remote commands, but our focus here is the file transfer capability. You can use FTP to transfer files to or from your System i, but FTP doesn't support the transfer of other i5/OS objects, such as libraries, programs, commands, or data areas.
To transfer these types of objects, you must first save them into an i5/OS save file. Because a save file is a file, you can then use FTP to transfer the file to another system.
Here are the steps to download an i5/OS library to a file on your PC:
CRTSAVF FILE(MYLIBRARY/MYSAVF)
TEXT('Save file for FTP')
SAVLIB LIB(MYFTPTEST) DEV(*SAVF)
SAVF(MYLIBRARY/MYSAVF)
a. Go to a DOS prompt.
b. Start the FTP client to connect to your System i:
C:\>ftp 10.0.1.177
c. Log in to FTP with your i5/OS user ID and password.
d. Set your directories as required (to keep from having to enter a long nasty path).
e. Set the i5/OS current library to the library that contains the save file:
ftp> cd mylibrary
f. Set the PC's local current directory where you want to place the save file:
ftp> lcd c:
g. Switch to binary transfer mode (to prevent data translation from occurring):
ftp> bin
h. Transfer the save file to your PC. Get the i5/OS save file into a new file on your PC. I like to use the extension .sav to help me identify save files on my PC:
ftp> get mysavf mysavf.sav
i. Log out of FTP:
ftp> quit
You now have the save file on your PC. You can send the save file via e-mail or simply upload it to another system on your network.
Here are the steps to upload a save file to your System i and restore the objects stored in the save file. The procedure is almost exactly the same as downloading the file, except you use FTP PUT instead of GET, and you do an i5/OS restore operation instead of a save.
CRTSAVF FILE(MYLIB/SAVF)
TEXT('Save file for FTP')
a. Go to a DOS prompt.
b. Start the FTP client to connect to your System i:
C:\>ftp 10.0.1.179
c. Log in to FTP with your i5/OS user ID and password.
d. Set your directories as required (to keep from having to enter a long nasty path):
e. Set the i5/OS current library where the save file exists:
ftp> cd mylib
f. Set the PC's local current directory where the save file exists:
ftp> lcd c:\
g. Switch to binary transfer mode (to prevent data translation from occurring):
ftp> bin
h. Transfer the save file to the System i. Put the i5/OS save file into the save file you created in step 1:
ftp> put mysavf.sav savf
i. Log out of FTP:
ftp> quit
RSTLIB SAVLIB(MYFTPTEST) DEV(*SAVF) SAVF(MYLIB/SAVF)
As for system integrity and security, you must control who has permission to save and restore objects. You cannot let users save and restore objects on your system when the administrator is out of the loop.
On a related topic, you should keep tight reins on who can use FTP on your system. You can use iSeries Access Application Administration for FTP to get some measure of control, but for the best protection -- and to create an audit trail of who did what through FTP -- use object-level security and FTP exit-point programs to control access.