Creating a Compression Policy

This operation enables you to compress specified files in a namespace to reduce space usage and user costs.

Prerequisites

Procedure

  1. Choose Resources > Tuning > SmartCompression.

    SmartCompression is disabled by default. When you go to the SmartCompression page for the first time, click Enable to enable it. After SmartCompression is enabled, you can log in to the CLI and run the following command to disable it.
    change shrink_global_parameter shrink_switch=off

  2. Select a desired account from the Account drop-down list in the upper left corner.
  3. Click Create.

    The Create Compression Policy page is displayed.

  4. Set the compression policy. Table 1 describes the related parameters.

    Table 1 Compression policy parameters

    Parameter

    Description

    Name

    Name of the compression policy.

    NOTE:
    • The name must be unique.
    • The name can contain only letters, digits, hyphens (-), and underscores (_).
    • The name consists of 1 to 63 characters.

    Execution Mode

    Execution mode of the compression policy. The options are Periodical and One-off.

    NOTE:

    If you set Execution Mode to Periodical, the compression policy is executed based on the configured period. The default execution time is 00:00 every day. You can modify the execution period in Setting the Compression Period. If you set Execution Mode to One-off, the compression policy will be executed immediately.

    Compression Mode

    • Compression: compresses specified files. The files after compression occupy less space but cannot be read or written.
    • Decompression: decompresses the compressed files. The files after decompression are restored to the original size and can be read and written.
    NOTE:

    If Execution Mode is set to Periodical, Decompression cannot be selected.

    Namespace

    Namespace for which the compression policy takes effect. Click Select. On the Namespace page that is displayed, select a desired namespace and click OK.

    Dtree

    Dtree for which the compression policy takes effect. Click Select. On the Dtree page that is displayed, select a desired dtree and click OK.

    File Directory

    File directory where the compression policy takes effect.

    If you do not select a dtree or file directory, the compression policy takes effect for the entire namespace. If you select a dtree but no file directory, the migration policy takes effect for the entire dtree.

    NOTE:

    This parameter is available only when Execution Mode is set to One-off.

    Filter Policy

    File filtering policy. The options are By file name, By file size, By file operation time, and By user or user group.

    • By file name

      Select Including or Excluding in File Name Filtering to determine whether files with specified names are included or excluded in the policy. Then, specify the file names to be filtered for or filtered.

      NOTE:
      • In the text box, 1 to 1023 characters can be entered.
      • Wildcard (*) can match any character. The following formats are supported: example, *, *example*, *example, example*, and example*example.
      • Multiple file names are separated using commas (,).
    • By file size

      Specify the size of files to be filtered for.

    • By file operation time

      Specify a specific operation time. The options are crtime, mtime, ctime, and atime.

      • crtime: file creation time.
      • mtime: file modification time.
      • ctime: file property modification time.
      • atime: last file access time.
    • By user or user group

      Select the type of the desired user or user group from the User or User Group Type drop-down list and then select Including or Excluding in User Name Filtering to determine whether files of the specified user or user group are included or excluded in the policy.

      • If you select LDAP domain user, LDAP domain user group, NIS domain user, or NIS domain user group in User or User Group Type, specify the user or user group name in Username or User Group Name.
      • If you select Local UNIX authentication user or Local UNIX authentication user group, click Select next to Username or User Group Name. On the Local UNIX Authentication User or Local UNIX Authentication User Group page that is displayed, select the desired user or user group and click OK.
    NOTE:
    • The compression policy takes effect for the files that meet all filtering policies.
    • It is recommended that the condition of the file operation time be used together with other time policies. For example:

      Set crtime to >, 7, and days, and atime to , 1, and days. That is, the files that are created one week ago and accessed in the last day are compressed.

    • After a compression task is started, files that meet the preset conditions are compressed one by one in the directory where the compression policy is set. Whether a file meets the conditions is determined during file processing. To prevent a condition from changing with the task execution time (for example, the value of crtime is set to , 1, and hours when the task is started but the value of crtime changes to >, 1, and hours when the file is being processed), set the condition value of to the one greater than the compression period in Setting the Compression Period.

  5. Click OK.