Triggering to affect archiving

The archive trigger type is used in conjunction with the +X filetype modifier to replace the mechanism by which the Helix Core Server archives files within the repository. Archive triggers are used for storing, managing, or generating content archived outside of the Helix Server repository. See Execution environment for platform-specific considerations.

The following table describes the fields of an archive trigger definition:

Field Meaning


The name of the archive trigger.


archive: Execute the script when a user accesses any file with a filetype containing the +X filetype modifier. The script can read, write, or delete files in the archive.

The script is run once per file requested.

For read operations, scripts should deliver the file to the user on standard output. For write operations, scripts receive the file on standard input.


A file pattern to match the name of the file being accessed in the archive.


The trigger for the Helix Core Server to run when a file matching path is found in the archive.

Specify the command in a way that allows the Helix Core Server account to locate and run the command. The command (typically a call to a script) must be quoted, and can take as arguments any argument that your command is capable of parsing, including any applicable Helix Server trigger variables.

When your trigger script is stored in the depot, its path must be specified in depot syntax, delimited by percent characters. For example, if your script is stored in the depot as //depot/scripts/, the corresponding value for the command field might be "/usr/bin/perl %//depot/scripts/". See Storing triggers in the depot for more information.

If the command succeeds, the command’s standard output is the file content. If the command fails, the command standard output is sent to the client as the text of a trigger failure error message.


This archive trigger fires when users access files that have the +X (archive) modifier set.

# - illustrate archive trigger


if [ "$OP" = read ]
    cat ${FILE}${REV}

if [ "$OP" = delete ]
    rm ${FILE}${REV}

if [ "$OP" = write ]
    # Create new file from user's submission via stdin
    while read LINE; do
        echo ${LINE} >> ${FILE}${REV}
    ls -t ${FILE}* |
        read first; read second;
        cmp -s $first $second
        if [ $? -eq 0 ]
            # Files identical, remove file, replace with symlink.
            rm ${FILE}${REV}
            ln -s $second $first

To use the trigger, add the following line to the trigger table:

arch  archive  path  " %op% %file% %rev%"

When the user attempts to submit (write) a file of type +X in the specified path, if there are no changes between the current revision and the previous revision, the current revision is replaced with a symlink pointing to the previous revision.