6.2.11.1 chxattr

Set an extended attribute for a file or vault.

Purpose

The chxattr command allows you to set an extended attribute for an Exascale file or vault.

Syntax

chxattr { file-name | vault-name } --name attribute-name { --value attribute-value | --bin-value-file file-name }

Command Options

The options for the chxattr command are:

  • { file-name | vault-name }: Specifies the name of the file or vault that is the subject of the operation.

  • --name: Specifies the name of the extended attribute.

  • --value: Specifies the value of the extended attribute.

  • --bin-value-file: Specifies the regular file from which to read the value of the extended attribute. The value is assumed to be binary.

Examples

Example 6-143 Set an Extended Attribute for a Vault

You can add an extended attribute to a vault, such as @MYDATA. The name of the attribute is custom_attr, and its value is myvalue.

@> chxattr @MYDATA --name custom_attr --value myvalue

Example 6-144 Set an Extended Attribute for a File

You can add an extended attribute to a file, such as @MYDATA/file1. The name of the attribute is custom_attr, and its value is myvalue.

@> chxattr @MYDATA/file1 --name custom_attr --value myvalue

Example 6-145 Set a Binary Extended Attribute for a File

You can add a binary extended attribute to a file, such as @MYDATA/file1. The name of the attribute is binary_attr, and its value is the contents of the file at /home/user/bin-val-in.dat.

@> chxattr @MYDATA/file1 --name binary_attr --bin-value-file /home/user/bin-val-in.dat