NETCOPY
This tool allows parameter-controlled network file transfers to be performed.
It will support file transfers between UNIX and
VMS systems. The files to transfer are specified with a filemask containing
wildcard characters. The filemask should be as specific as possible to
avoid undesired results. The destination for the copy must be a directory.
By default, the FTP file transfer protocol is used, but when running
on a UNIX host, a mode using RSH/RCP is
also available.
Parameters can be supplied to the tool either on the command line, or
from a disk file (i.e. a resource file). The tool can be run within an
OPUS pipeline by invoking it from a shell script and running the shell
script within the pipeline via the OPUS XPOLL facility.
File transfers are, by default, confirmed
by listing the files AFTER the copy completes in the destination directory.
If the transfer is confirmed, the original source files can be deleted
if the DELETE_AFTER_COPY option is selected.
Usage: netcopy -pa pathfile |
-fil parmfile |
-rm remote_machine -rt remote_machine_type -rf remote_filespec
-lf local_filespec
[-rl remote_login] [-fi firewall_name] [-delete_after_copy] [-safe_copy_mode]
[-rollback_failed_copy] [-dslop disk_slop_percent] [-nc] [-nd]
[-t temp_directory] [-log logfilename]
[-ft file_type] [-pg put_or_get] [-pw passwd] [-rsh_rcp_mode]
If either the pathfile or parmfile parameter is supplied, the rest of the
parameters are ignored on the command line, as they are obtained from the
provided file instead.
The flags can be specified in any order by any number of unique characters
(e.g. -de, -del, and -delete are treated equally).
Context
Inputs
Command line or file parameters.
OPUS path file.
OPUS resource file.
Outputs
Constraints
There must be sufficient disk space on
the destination device to perform the copy, if the destination is the local
system (i.e. a GET operation). No disk space checks are made on the remote
system when a PUT is performed.
The destination for the copy (local or remote) MUST be a directory.
The user must have copy/delete privilege in the source directory to
copy and optionally delete the source files.
The RSH/RCP mode is only available when running NETCOPY on a UNIX host.
A usage error will occur if RSH/RCP mode is requested from a VMS host.
The RSH/RCP only works if the remote account being accessed does not
generate any output in its login procedure (shell). Output during
login confuses RCP, and copies will not work properly, though there may
no error message indicated that the copy failed for this reason.
In fact, the only message may be that no matching files were found on the
remote host.
Wildcards in filemasks must be escaped (using \) when running
on a UNIX host using FTP mode.
Wildcards in filemasks must not be escaped when running on a
UNIX host using RSH/RCP mode.
Resource file
The following parameters appear in the NETCPY resource file. Their values
can be specified directly in the resource file itself, or be pulled through
from the path file by giving them path file mnemonics as their values.
FIREWALL
The name of the firewall if the task is invoked on a machine behind
a firewall. Different FTP syntax is used for these copies on VMS systems.
REMOTE_MACHINE
The machine name for the remote host (e.g. ajuga)
REMOTE_FILESPEC
The directory where files will be looked for on the remote host (e.g.
/home/mswam/lookhere)
NETCPY_MAIL_FILE
The logfile which will contain status and error messages written during
the NETCOPY run. This file can be e-mailed to the operator by a pipeline
script. (e.g. disk$scooby:[temp]netcopy.mail )
LOCAL_FILESPEC
The directory on the local machine where files will be copied to (e.g.
DUDBUF)
REMOTE_LOGIN (optional)
The login name for the remote machine, if different from the login
name that starts the NETCOPY command.
REMOTE_TYPE
The operating system type of the remote system. Possible choices are
VMS or UNIX. The operating system type of the local system is known by
the software.
DISK_SLOP_PERC
The extra percentage disk space that is added to the exact disk space
required when determining if enough space exists for catalog installation.
(e.g. Providing a value of "3" implies that "1.03*exact space required"
will be used to determine if sufficient disk space exists, i.e. 3% slop)
DELETE_AFTER_COPY
If set to YES or TRUE, this flag indicates that successfully copied
files should be deleted from the remote host.
ROLLBACK_PARTIAL_COPY
If set to YES or TRUE, this flag indicates that partial copies of filesets
will not be performed. If one or more files from a fileset cannot be copied
back successfully, all of the files will remain on the remote host. This
only affects failure of a copying operation.
SAFE_COPY
If set to YES or TRUE, this flag indicates that all file PUT operations
will be performed as PUT/RENAME combinations. The destination filename
is first altered by appending "_tmp", the file is copied, and then the
file is renamed in the destination directory to restore the original filename.
This option is intended for applications where a process will be polling
for the file that NETCOPY is transferring. Using FTP, the PUT operation
makes the file visible on the remote system before the file contents are
complete. Using SAFE_COPY means the file is not visible on the remote
system until it is complete. This should satisfy processes polling
on the transferred file.
NOTE: Setting SAFE_COPY to YES implies that NO_COPY_CONFIRMATION will
be set to YES as well. If you need a safe copy to be performed, it
is likely that the copied file will not be around long enough for the normal
copy confirmation read to succeed, so it will be suppressed. The
code will automatically make this occur, no matter what appears in the
value for the NO_COPY_CONFIRMATION parameter.
NO_COPY_CONFIRMATION
If set to YES or TRUE, this flag indicates that the confirmation listing
of the destination directory AFTER a file copy occurs will NOT be performed.
This can be used to avoid error messages that might result should another
process or person remove the sucessfully copied files from the destination
directory before the confirmation read can take place. Setting the
SAFE_COPY parameter to YES will automatically result in this parameter
also being set to YES, no matter what value you set it to, since using
SAFE_COPY implies a concern that the files copied will be quickly acted
on by some process or person.
NO_DELETION_CONFIRMATION
If set to YES or TRUE, this flag indicates that the confirmation listing
of a remote source directory AFTER a requested file deletion occurs will
NOT take place. Normally, after deleting a source file (by request
through the DELETE_AFTER_COPY parameter)
a confirmation listing is made of the source directory to confirm that
the file is no longer there. This confirmation listing can be supressed
by the use of this parameter.
TEMP_DIR
Directory name or logical where temporary files can be created. NETCOPY
will normally clean up all temporary files it creates, unless there is
an unexpected problem. If running from a UNIX system, a good value for
this parameter is "/", which will allow the system-defined temporary filespace
to be used for temp files.
FILE_TYPE
Controls the type of file transfer performed by the FTP operation.
The choices are ASCII and BINARY.
PUT_OR_GET
Indicates whether pulling (GET) files from or pushing (PUT) files to
the remote system.
USE_RSH_RCP
Use the RSH/RCP mode of file
transfer, as opposed to the default mode of FTP. This assumes that
the proper set up on the remote system has been performed to allow RSH/RCP
access. See the system documention on RSH/RCP for detail on this
setup.
Qualifiers
-pa[thfile]
Name of the pipeline path file.
-fil[ename]
Name of a parameter filename (same contents as process resource file)
-rm[achine]
-rt[ype]
-rf[ilespec]
-lf[ilespec]
-rl[ogin]
-ds[lop_percentage]
-de[lete_after_copy]
-ro[llback_partial_copy]
-saf[e_copy_mode]
Same as SAFE_COPY
-nc[opy_confirmation]
Same as NO_COPY_CONFIRMATION
-nd[eletion_confirmation]
Same as NO_DELETION_CONFIRMATION
-fir[ewall]
-t[emp_directory]
-lo[gfile]
-ft[ype]
-pg
-rs[h_rcp_mode]
Same as USE_RSH_RCP
-pw[ord]
Encrypted password used to connect to the remote system. If this
parameter is not provided, then the password will be prompted for interactively.
Even in interactive mode, the password should still be entered in encrypted
form.
Examples
$ netcopy -pa opus_definitions_dir:blue.path
Uses values from the process resource file (opus_definitions_dir:netcpy.resource)
to determine which remote machine and directories should be searched for
files. The password for the remote system will be prompted for.
$ netcopy -rm ajuga -rt UNIX -pg GET -rf /home/mswam/data/*.c -lf
disk$lyra:[mswam.dest] -delete -pw q1w2e3r4e3w2q1
Searches for files matching the filespec "/home/mswam/data/*.c" on the
UNIX machine "ajuga". If found, they are copied back to "disk$lyra:[mswam.dest]".
If the files are copied successfully, they are deleted afterwards from
the remote host "ajuga". FTP is used for all file transfers.