Skip to main content

Using a command or program to create a WORM appendable file

You can use any suitable command or program over NFS or CIFS to create a WORM appendable file. A WORM appendable file retains data written incrementally, like log entries. Data is appended to the file in 256 KB chunks. As each chunk is written, the previous chunk becomes WORM-protected. You cannot delete the file until the retention period has elapsed.

Before you begin

The WORM appendable file must reside on a SnapLock volume.

About this task

Data does not have to be written sequentially to the active 256 KB chunk. When data is written to byte n×256KB+1 of the file, the previous 256 KB segment becomes WORM-protected.

  1. Use a suitable command or program to create a zero-length file with the desired retention time.

    Example

    In a shell, use the following command to set a retention time of 21 November 2020 6:00 a.m. on a zero-length file named document.txt :
    touch -a -t 202011210600 document.txt
  2. Use a suitable command or program to change the read-write attribute of the file to read-only.

    Example

    In a shell, use the following command to make a file named document.txt read-only:
    chmod 444 document.txt
  3. Use a suitable command or program to change the read-write attribute of the file back to writable.

    Note
    This step is not deemed a compliance risk because there is no data in the file.

    Example

    In a shell, use the following command to make a file named document.txt writable:
    chmod 777 document.txt
  4. Use a suitable command or program to start writing data to the file.

    Example

    In a shell, use the following command to write data to document.txt :
    echo test data >> document.txt

    Note
    Change the file permissions back to read-only when you no longer need to append data to the file.