CHCOS Command


HSI Version: 



Change class of service of HPSS file(s) 



Command Format: 

chc[os] [-A] [-h] [-i subsys]  [-N] [-R] [-s streamID]
 [-T max_threads]  [-Z] new_cos|auto path ... [<<MARKER]


-A: enable stage optimizations (default)

-h : Follow symbolic links during recursion. The default behavior is not to follow symbolically-linked directories.

-i subsys: (HPSS 7.1+) specify subsystem id to use for multiple COS Change threads.  Default is 0 - use the current subsystem.

-N : disables auto-scheduling of files (by Volume and Position). This option normally should not be used, to avoid unnecessary tape mounts.

-R : recursively traverse directories in the specified path(s)

-s streamID : specifies COS Change stream ID (0 ..n) to use

-T max_threads: (HPSS 7.1+) set max COS Change threads to use.  Default is to use all threads available for the subsystem. See usage notes below.  

-Z : internal autoscheduler debug flag. Displays sched results but doesn't issue the HPSS chcos call(s)

new_cos : specifies the COS ID to be used, which must be one which you are elegible to use for the HPSS connection(s) specified by the "path" parameter(s) (use "lscos" to see a list of COS IDs) "chcos 0" is always permitted; it removes files from the BFS chcos queue

auto : use auto-COS selection to choose the new COS ID, based upon current settings for # copies, account ID, group ID, and user ID

MARKER : specify HERE-document terminator sentinel (see options, below)

  • MARKER may optionally be preceded by one or more whitespace characters following the here document sentinel "<<";
  • Lines following the MARKER, which must be the last item on the line, will interactively prompted for with "FILENAME". Each line will contain pathnames (which may include wildcards).
  • The list is terminated by a line containing MARKER as the first token on the line.



Usage Notes: 

1. If new-cos is specified as auto, then each file object is tested to see in which COS it best fits based on criteria defined in the HSI COS file or in the HPSS system configuration. Otherwise HSI will attempt to change COS to that specified in the new-cos parameter. 

2. The -T option is normally not useful except to throttle the number of threads that are used for chcos operations.  Use of this option can cause chcos requests to be queued unnecessarily.

3. The shell-style HERE-document syntax can be used to to specify an interactive list of paths, or can be used in an IN file:

Interactive mode:

hsi chcos auto file1 file2 << EOF
FILENAMES: file3 file4

Using an IN File:

hsi in stageInput

Contents of file "stageInput"

chcos auto file1 file2 << EOF
file1 : hpss_file1 file2 : hpss_file2 file3 file4
file5 : hpss_file5

4. For HPSS 7.1 and beyond, HSI attempts to use multiple background "change cos" threads in the Core Server by first organizing all files by virtual volume and position, and then issuing requests for each change-cos thread so that:

a. All requests for a particular tape VV are issued to the same change-cos thread

b. As many change-cos threads as are configured are used concurrently.

5. HSI will query the current or specified (-i option) subsystem to determine the maximum number of change-cos threads that are available at the start of each new command, so that HPSS administrator changes to the number of available COS-change threads are automatically taken into account.


  • Recursively change all files to COS ID 2

    chcos -R 2 some_directory
  • Change all files in the current directory from 1-copy to 2-copy, based on size.
    Note that files that are already in the correct COS will not be changed

    set copies=2; chcos auto *

Related Command(s):