dncopy - Copy files to/from a VMS system
dncopy [options] source dest
dncopy [options] source... directory
[-vdisklEVh] [-m mode] [-a record attributes] [-r record format] [-b
block size] [-p VMS protection]
dncopy copies files to and from VMS systems.
Files on VMS systems should be specified in the usual transparent
DECnet format of node"username password"::[directory]file. To protect
quotes and dollar signs from shell expansion I recommend that all VMS
file specifications be enclosed in single quotes (see EXAMPLES below).
If you don’t want to type the password on the command-line then put a
hyphen ("-") in its place and you will be prompted for it.
dncopy can copy single files and multiple files. If mutiple files are
copied the destination must be a directory but it may be on the local
Linux system or a VMS system. The files to be copied can be a mixture
of VMS files and local files (yes, you can copy from VMS to VMS with
this program, though quite why you would want to I’m not sure)
Wildcards are supported for local and VMS files (of course local
wildcards are expanded by the shell). Remember to use VMS wildcards
(*%) on VMS filesystems and Unix wildcards (*? etc) on Unix files.
The pseudo-filename ’-’ may be used to represent standard input or
standard output to enable dncopy to be used in a pipeline. Filenames
are changed to lower case when copied from VMS to Linux.
The environment DNCOPY_OPTIONS may be used to provide a default set of
options for copying files. If (for example) you wanted to normally send
files as blocks rather than records you could set
DNCOPY_OPTIONS="-mblock". Then, to send a file as records you would
need to type dncopy -mrecord myfile.txt vmsbox:: instead.
Options in DNCOPY_OPTIONS may be overridden by options typed on the
command-line except where there is no negating option available (see -k
-d -i ). If you put these options in DNCOPY_OPTIONS then to remove them
you will have to override the whole environment variable eg:
$ DNCOPY_OPTIONS="" dncopy myfile.txt vmsbox::
dntype is simply a version of dncopy where the output file is forced to
"-". Thus it takes all the same options as dncopy. It is merely a
-v Verbose operation. The more -v options are present the more
verbose dncopy will become. One -v is roughly equivalent to the
/LOG qualifier on the DCL copy command. More than one is really
just useful for debugging.
-i Interactive operation. Prompts before copying a file. This
option is roughly equivalent to the /CONFIRM qualifier on the
DCL copy command.
-l Ignore interlocks on files copied from VMS. This will do its
best to read the data regardless of record or file locking, but
it won’t always succeed.
-s Show transfer statistics. This shows the throughput of all
copies (in the case of wildcard transfers) undertaken in K
bytes/second. This time does not include that to establish the
connection. eg when sending to VMS the overhead of creating a
NETSERVER process is not included.
-k Keep version numbers on files copied from VMS systems. By
default dncopy will strip the version number from files because
they have no meaning in Linux. if you specify -k on the command
line then the VMS file will be created with exactly the same
name as it had on the VMS system. To access these files under
Linux you will need to enclose them in quotes. eg less
Sets the transfer mode to block or record. record is the
default. Normally record is what you want but block is used for
sending binary files to the VMS system. Note that if you use
-mblock to pull files from VMS you may not be able to make sense
of the file on Linux because dncopy will also pull all the VMS
internal structuring of the file as well as the data. Unless you
really know what you are doing -mblock is only really useful for
Sets the carriage control attributes for files copied to a VMS
system. The default is cr.
Sets the record format for files copied to a VMS system. The
default is stm. In fact the default is STREAMLF as this
corresponds to the format of files on Unix systems and so is the
least likely to result in file corruption. If you are sending a
pure text file then var or vfc may be more appropriate for your
application. fix may be useful for block-structures files and
-b N Set the block size for transfers. The default is high enough for
all record structured files. if you are sending a file with
-mblock then you should use this to set the block size of the
file to be created at the VMS end. When sending block files the
default changes to 512 as this is typically what you would want
-d Remove any trailing CR characters at the end of a line. This is
useful for sending DOS files to VMS. Only works when
transferring in record mode.
When sending files to VMS, sets the protection of the newly
created remote file. Without this option, VMS will set the
protection to be the default for the remote user. The
protection should be in VMS-style format and enclosed in single
quotes to protect it from the shell (see example).
This option is ignored when copying from VMS.
-P Queue the file for printing to SYS$PRINT when it arrives at the
-D Delete the file when it is closed. This is only really useful in
conjunction with -P.
-T connect timeout
Specifies the maximum amount of time the command will wait to
establish a connection with the remote node. a 0 here will cause
it to wait forever. The default is 60 seconds
-E Ignore errors opening output files. This is handy if you are
sending a lot of Unix files to VMS, some of which have illegal
filenames (eg ~ backup files). dncopy will report an error for
each file but continue sending.
-h -? Displays help for using the command.
-V Show the version of the tools package that dncopy comes from.
You can put your most commonly used defaults in the environment
variable DNCOPY_OPTIONS eg:
bash or ksh:
$ DNCOPY_OPTIONS="-mblock -anone -b1024" ; export DNCOPY_OPTIONS
csh or tcsh:
$ setenv DNCOPY_OPTIONS "-mblock -anone -b1024"
makes dncopy send files as 1024 byte blocks with no carriage control.
You can override these options by specifying replacements on the
command-line as usual. Be aware that some options have no converse (eg
-i -k -d -v) so if you put these in DNCOPY_OPTIONS you cannot disable
them without deassigning the variable.
Copy LOGIN.COM from the VMS system "tramp" to Linux as mylogin.com
dncopy ’tramp"christine pjc123"::login.com’ mylogin.com
Copy all .TXT files from the VMS directory SYS$SYSDEVICE:[WP] to /tmp:
dncopy ’tramp"christine pjc123"::sys$sysdevice:[wp]*.txt’ /tmp
Copy an executable to VMS:
dncopy -mblock test.exe ’tramp"christine pjc123"::[.BIN]’
Copy a file to VMS and set its protection
dncopy secret.dat marsha:: -p (s:, o:rwed, g:re, w:)’
Display the contents of LOGIN.COM:
dtype ’trisha"christine -"::login.com’
You will then be prompted for a password
For fetching files the defaults should serve for most purposes. Most
VMS files are record orientated and -mrecord is the default transfer
mode. It is rare you will need to fetch files using -mblock because you
will get all the record control information downloaded too and that
probably isn’t any use to you.
Sending files is more complex because VMS supports far more attributes
than Linux so you will need to know something about the file you are
sending. Text files should be OK with the defaults unless you need to
change the format from the default STREAMLF to VFC or VAR. Carriage
control can also be specified if you want to be that picky.
Binary files may often need to be sent -mblock to be useful at the VMS
end, You will probably want to specify a block size with the -b option.
The default is 512 which is fairly useful but if you are sending (say)
a saveset 8192 or 32256 may be required. Trial-and-error may be the
only way in some cases unless you know the file contents very well. If
you really don’t know what to do, just send it -mblock and use the set
file/attr command to massage it on the VMS end until you are happy with
it. (If you are using VMS earlier than 6.1 then you will need the
freeware FILE utility to do this)
dntype(1), dndir(1), dndel(1), dntask(1), dnsubmit(1), dnprint(1)