Working with FTP server jobs and job log

 

You can research FTP errors by obtaining a spooled file of the FTP server job log. The FTP server automatically writes a server job log to a spooled file when it ends with an error.

A server job log can be written to a spooled file without ending the connection by issuing the following subcommand from an FTP client:

     QUOTE RCMD DSPJOBLOG

To obtain a copy of error messages written to the FTP server job log, this subcommand must be issued after the error has occurred. You can then inspect the job log using the Work with Spooled Files (WRKSPLF) command.

This technique is suggested in those cases where the reply message that is returned to the client from the FTP server only provides minimal information about an error that is occurring on the FTP server. For example, this method is useful for obtaining details about I/O errors that occur on the system that the FTP server is on.

If the error prevents the FTP server job log from being obtained by the method described here, enter the following command to force a spooled job log to be created for each FTP session:

     CHGJOBD JOBD(QUSRSYS/QTMFTPS) LOG(4 00 *SECLVL)

Then recreate the scenario which causes the error. To restore the original job log behavior after obtaining the required data, enter the following command:

     CHGJOBD JOBD(QUSRSYS/QTMFTPS) LOG(4 00 *NOLOG)

To have a spooled job log produced at the end of each FTP session and each time an FTP server ends (with or without an error), use the Change Job Description (CHGJOBD) command as follows:

     CHGJOBD JOBD(QUSRSYS/QTMFTPS) LOG(4 00 *SECLVL)

To get a spooled job log only when a connection ends, use the CHGJOBD command as follows:

     CHGJOBD JOBD(QUSRSYS/QTMFTPS) LOG(4 00 *NOLIST)

 

FTP server jobs and job names

The FTP server jobs are started when the Start TCP/IP (STRTCP) command is run and with the FTP AUTOSTART parameter is set to *YES, or when the Start TCP/IP Server (STRTCPSVR) command is run with a SERVER parameter value of *FTP or *ALL. These jobs run in the QSYSWRK subsystem and their purpose is to monitor for incoming FTP users. The format for the names of these jobs is QTFTPnnnnn, where nnnnn is the job number of the FTP server job submitting to this FTP server.

To work with FTP server jobs, enter the following CL command:

     WRKACTJOB JOB(QTFTP*)

 

Parent topic:

Troubleshooting File Transfer Protocol
Related reference
Work with Spooled Files (WRKSPLF)