Introduction to NCAR's Mass Storage System

Reading or writing MSS files with msrcp

The msrcp command copies files to or from the MSS. The msrcp command should be used in preference to the msread and mswrite commands, where possible.
Advantages and disadvantages of msrcp
Advantages of msrcp Disadvantages of msrcp
Supports wildcards Does not support file conversion, such as COS-blocking
Supports recursive copying
Has UNIX-like syntax
Provides MSS access for computers that do not have a direct MSS connection

The basic syntax of the msrcp command is:

msrcp [options] source_file [source_file...] target

where:

source_file
One or more pathnames residing on either the local host or the MSS. If the source files reside on the MSS, the filenames must begin with the mss: prefix. MSS filenames can contain wildcard characters (in quotes).
target
The destination pathname on either the local host or the MSS. If the target resides on the MSS, the filenames must begin with the mss: prefix. If the target includes an MSS directory path that doesn't already exist, the MSS automatically creates the directory path.

The msrcp options are listed below. For more details, see the man page.

-a[sync]
Asynchronous mode. Prints the request identifier to standard out (stdout)and exits with a 0 (zero) status. The transfer occurs later. You are responsible for verifying the transfer succeeded.
-cl[ass] cos
Provide cos as the class of service information for files written to the MSS. See the msclass (1-dcs) man page for details.
 
-m[axtrans] n
Multi-file request, with n as the maximum number of transfers being requested. The system may reset this to a lower number, depending on the current load and the host computer.
-pe[riod] n
MSS retention period. The default is 32 days. You can specify n as an integer in the range of 1-32767 days (almost 90 years).
-pr[oject] proj
Project number associated with your request. If not specified, a default number is obtained. See the msrcp man page for details.
-rpwd pass
Read password, where pass is 1-8 characters.

When writing a new MSS file, pass specifies the read password to be assigned to the new MSS file. The default is no password.

When reading an existing MSS file, pass must specify the read password of the existing MSS file. If the existing MSS file has no read password, the -rpwd option must be omitted.

When writing over an existing MSS file, pass must specify the read password of the existing MSS file. If the existing MSS file has no read password, the -rpwd option must be omitted.

The mspasswd command can also be used to assign, change, or remove a read password.

-wpwd pass
Write password, where pass is 1-8 characters.

When writing a new MSS file, pass specifies the write password to be assigned to the new MSS file. The default is no password, but SCD recommends you assign write passwords.

When reading an existing MSS file, pass is not needed, and if specified, will be ignored.

When writing over an existing MSS file, pass must specify the write password of the existing file. If the existing MSS file has no write password, the -wpwd option must be omitted.

The mspasswd command can also be used to assign, change, or remove a write password.

-R
Recursive. If used and one or more arguments in the source_file list refer to a directory, traverse that subtree and copy all files in the subtree. In this case, target must also be a directory.

Examples

Example 1: Write a file from the local host to the MSS and give the MSS file a write password of secret:
msrcp -wpwd secret myfile mss:/JOEUSER/scmedir/data

Example 2: Read an MSS file to the local host:

msrcp mss:/PAT/datafile new_data

The msrcp command can also accept wildcard characters and do recursive copies. See the man page for more examples.

Writing MSS files from running jobs

When you write MSS files from jobs running on SCD supercomputers, it is best to write them asynchronously. If you call msrcp from a running job, use option -async to do this. If you call mswrite, specify option -nowait. This way, msrcp and mswrite will queue the request and immediately return with a 0 (zero) status. This benefits the user and the computer because the job's nodes will be freed earlier, reducing charges and allowing other jobs to begin execution. You are responsible for checking to make sure the transfers succeeded. See the mswrite and msrcp man pages for information.

Reading an MSS file with msread


NOTE: The preferred method for reading files from the MSS is msrcp.

For reading files from the MSS, use the msread command, which transfers a copy of a file from the MSS to the computer where you are working. The original file remains on the MSS.

The msread command has many options, but generally, only a few are necessary to complete basic file transfers. The options not discussed below are documented in the msread man page. Be sure to see the man page if you have special file transfer requirements.

The basic form of the msread command is:

msread [options] loc_flnm [MSS_flnm]

where:

loc_flnm
The name of the local disk file.
MSS_flnm
The name of the MSS file. If this argument is not specified, msread will construct an MSS filename based on your MSS working directory and the loc_flnm. If you are in your MSS home directory, the form will be: /YOUR_LOGIN/loc_flnm.

There are many options for msread; the most common options are discussed below.

-R
Tells msread to replace an existing local file of the same name as the loc_flnm argument with the MSS file. By default, if loc_flnm exists on the host computer, msread immediately exits with a warning message and status of 3, and the file transfer does not occur.
-r pass
The read password associated with the MSS file is pass.

Example

You want to transfer a copy of the file /MORREALE/data/file1 to the computer where you are working and give it a local name of file.1. The MSS file has a read password of MyPass. If file.1 already exists in the current directory, you want msread to replace it with a new version of the file.
msread -r MyPass -R file.1 /MORREALE/data/file1

Writing a file to the MSS with mswrite


NOTE: The preferred method for writing files to the MSS is msrcp.

For writing files to the MSS, use the mswrite command, which transfers a copy of an existing disk file to the MSS, leaving the original file on the computer where it resides.

The mswrite command has many options, but like msread, only a few are necessary for basic file transfers. For a complete discussion of the mswrite options, see its man page.

The format of the mswrite command is:

mswrite [options] loc_flnm [MSS_flnm]

where:

loc_flnm
The name of the local disk file you want transferred to the MSS.
MSS_flnm
The MSS name you want to assign to the file. If this argument is omitted, mswrite constructs an MSS filename based on your MSS working directory and the loc_flnm. If you are in your MSS home directory, the form will be: /YOUR_LOGIN/loc_flnm.

Some of the more common options to mswrite are:

-C class-of-service
The "class of service" to be associated with the file on the MSS. Class of service is specified as a list of comma-separated keyword-value pairs of the form "keyword=value". If the class-of-service string contains blanks, the entire string must be enclosed in quotes. Two keywords are currently supported: "usage" and "reliability". For information on these two classes of service, what values are currently supported, and what effect different classes of service have on your MSS files, please refer to the "msclass" man page.
-c cmnt
The comment to be associated with the file on the MSS. Specify a string of 1 to 80 characters. The case of the string is preserved, and leading and trailing white space is removed. If the comment string contains blanks, enclose the entire string in single quotation marks to preserve the blanks. Any character except for the comma "," can be used in the comment string.

NOTE: The allowed comment characters with the mscomment command are currently different.

-r rpass
The read password for the MSS file. This option sets the read password for the MSS file to rpass.
-t n
The MSS retention period. The default retention period is 32 days. You can specify n as an integer in the range of 1-32767 days (almost 90 years).
-w wpass
The write password for the MSS file. This option sets the write password to wpass.
-nowait
Asynchronous file transfer. This option tells mswrite that this is an asynchronous transfer request. The request queues and immediately returns without waiting for the mswrite to complete. By default, all file transfers are synchronous.

Example

Here is an example of mswrite that sets a retention period of 250 days and sets a write password of Wpass and a read password of Rpass. This example writes the local file file.1 to the MSS with a MSS filename of /PAT/moreData.
mswrite -t 250 -w Wpass -r Rpass file.1 /PAT/moreData

| Table of contents | SCD home page |

If you have questions about this document, please contact SCD Customer Support. You can also reach us by telephone 24 hours a day, seven days a week at 303-497-1278. Additional contact methods: consult1@ucar.edu and during business hours in NCAR Mesa Lab Suite 39.

Last update: 09/05/2006

© Copyright 1992-2006. University Corporation for Atmospheric Research (UCAR). All Rights Reserved.

Address of this page: http://www.scd.ucar.edu/docs/mss/read-write.html