NETCOPY
This tool allows parameter-controlled network file transfers to be performed.
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.
The SFTP file transfer protocol is used for all transfers, so PKI keys are
expected to be in place to allow copying without supplying a password
(see UNIX ssh-keygen man page for details on key set-up). All transfers
are done in BINARY mode (since most SFTP implementations only support
that mode), so text file transfers to/from Windows systems for files using
CR-LF delimiters are not properly supported.
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 -rf remote_filespec
-lf local_filespec
[-rl remote_login] [-delete_after_copy] [-safe_copy_mode]
[-rollback_failed_copy] [-dslop disk_slop_percent] [-nc] [-nd]
[-t temp_directory] [-log logfilename]
[-pg put_or_get]
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.
Wildcards in filemasks must be escaped (using \) when running
on a UNIX host using FTP 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.
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.
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.
PUT_OR_GET
Indicates whether pulling (GET) files from or pushing (PUT) files to
the remote system.
-
Qualifiers
-pa[thfile]
Name of the pipeline path file.
-fil[ename]
Name of a parameter filename (same contents as process resource file)
-rm[achine]
-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
-t[emp_directory]
-lo[gfile]
-pg
-
-
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.
$ netcopy -rm ajuga -pg GET -rf /home/mswam/data/*.c -lf
/here/there/everywhere/ -delete
Searches for files matching the filespec "/home/mswam/data/*.c" on the
UNIX machine "ajuga". If found, they are copied back to directory
"/here/there/everywhere/".
If the files are copied successfully, they are deleted afterwards from
the remote host "ajuga".