Use the Move adapter command (-MOVE) to
move files from their original location on the source FTP server to a different
location on the source FTP server after the files have been transferred to
the target server. On the Move adapter command, specify a new name for the
original source file as a different file name, path, or both.
The FTP
Adapter typically provides options for deleting or keeping files on the source
FTP server after the files were transferred to the target FTP server. The
Move command provides additional functionality that permits you to move the
files to a different location on the source server, as opposed to, for example,
deleting them.
-MOVE [file_name | directory_location]
- Option
- Description
- file_name
- Specifies the new name on the source FTP server for the original file
that was transferred. This can be specified as the absolute (fully qualified)
or relative path for the source file.
- The following commands demonstrate examples of how you can specify new
names for the original file on the source FTP server as absolute and relative
path names when the original file name in the FTP command to be downloaded
is specified as myoriginalfilename.txt:
-MOVE /mynewfilename.txt
- This Move command, specified with an absolute path and new file name,
moves the myoriginalfilename.txt file after it is downloaded,
from its original location on the source FTP server to your root directory
for that FTP client and renames it mynewfilename.txt.
-MOVE mynewfilename.txt
- This Move command, specified with a new file name, renames the myoriginalfilename.txt file
after it is downloaded, to mynewfilename.txt on the source
FTP server.
- directory_location
- Specifies the different directory or subdirectory name on the source FTP
server for the original file or files that were transferred. The directory
name must be terminated with a path separator. Examples include: backward
slash (\) for Windows and forward slash (/) for UNIX environments.
- If the directory does not exist and the MKD option
is also specified on the command line, the directory will be created relative
to the current location of the file or files on the source FTP server, that
have already been downloaded.
- If the directory does not exist and the MKD option
is not specified on the command line, the adapter will fail.
- If you are not sure that the directory exists, use the MKD option.
When you specify this command option whether or not the directory exists,
the adapter command will avoid a failure result. If the directory does exist,
the MKD option will not attempt to create the directory
and the adapter command will continue.
- The following commands demonstrate examples of how you can specify an
existing or new subdirectory name for the original file on the source FTP
server when the original subdirectory name in the FTP command is specified
as myoriginalsubdir:
-MOVE /mydiffexistingsubdir/
- This Move command, specified with a different subdirectory that already
exists, moves the file after it has been downloaded, from its original location
on the source FTP server to the mydiffexistingsubdir subdirectory
with its original file name.
-MOVE /mynewsubdir/ -MKD
- This Move command, specified with a new subdirectory, makes the new mynewsubdir subdirectory
in a location that is absolute to the current location, and then moves the
file after it has been downloaded, from its original location on the source
FTP server to the new subdirectory with its original file name.