The typical ssh keygen and authorized_keys file are needed to set up a remote login without a password prompt. Configuring and testing login without password can be done with ssh or scp or sftp.
When sftp is able to log in without a password prompt, it is then time to create a batch file. The batch file contains sftp commands. In the batch file, a leading hyphen "-" instructs sftp to ignore an error.
$ cat sftp.batch
ls -l /u001/testfile.Z
The command is:
/bin/sftp -bsftp.batch ftpuser@ftphost