DNCOPY(1) | General Commands Manual | DNCOPY(1) |
dncopy - Copy files to/from a VMS system
dncopy [options] source dest
dncopy [options] source... directory
dntype source...
Options:
[-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 multiple 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 convenience.
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)
January 26 2005 | DECnet utilities |