B.19 sputil

Use this utility to perform the purge operation.

B.19.1 Syntax

/opt/novell/nss/sbin/sputil 
sputil <AOPTION> <PAOPTION> [POPTION] [OPTION]

B.19.2 Options

This section describes the OPTION, AOPTION, PAOPTION, and POPTION options available in the SPUTIL utility.

NOTE:The command action is irreversible.

General Options (OPTION)

Option

Description

--force

Performs the purge operation by suppressing all user confirmations.

--dry-run

Use this option to display the total number of files that could be purged from volumes and the total space that could be reclaimed in a pool after purging.

--list-files

Use this option to view all the deleted files and the time of deletion. This option should be used only with the --dry-run option.

-h, --help

Displays the help information.

    --version

Displays the version.

Action Options (AOPTION)

Option

Description

--purge

Invokes the purge operation.

Purge Action Options (PAOPTION)

Option

Description

--get

Lists the volume configurations.

--set

Sets the volume configurations.

--exec

Executes the operations based on the configurations that have been preset.

NOTE:To obtain the statistics information, run --dry-run option

--clear

Removes the file pattern that is configured during the set operation.

Purge Options (POPTION)

Option

Description

-e, --ext

This option is deprecated. Use pattern.

NOTE:--get option displays an already configured extension as pattern.

-a, --age

Specify the age in seconds(s), minutes(m), hours(h), or days(d). Any file that is older than the specified age is purged. The default value is in days. If the value is 0, no purge action is performed. The maximum age is 49710 days. For example:

-a 30s
-a 30m
-a 20h
-a 300d
-a 0
-p, --poolname

Specify the pool name.

-v, --volname

Specify the volume name.

  --pattern

Specify the file pattern. More than one pattern can be specified with a single -pattern separated with forward slash (/).

NOTE:--set or --clear converts the already configured extensionsinto patterns.

  --pattern-age

Specify the file pattern age in seconds(s), minutes(m), hours(h) or days(d).

If you do not specify a --pattern-age for a pattern, then that pattern will be configured with a -pattern-age of 0 days.

--all-patterns      

Remove all the file patterns that have been configured using the set operation. Use with -clear.

B.19.3 Examples

  • To list all the pools and volumes configurations:

    sputil --purge --get

  • To set the configuration for purge operation with the age as “250d”, file extension as “doc”, and volume name as “VOL1”:

    sputil --purge --set --age 250d --volname VOL1

    NOTE:A deleted file is purged if it was deleted 250 days earlier.

  • To set purge configuration for a file pattern "file*.doc" with the pattern-age of 250 days for the volume VOL1 use either of the following:

    sputil --purge --set --pattern "file*.doc" --pattern-age "250d" --volname VOL1

    sputil --purge --set --pattern "file*.doc" --pattern-age "250" --volname VOL1 sputil --purge --set --pattern-age "250d" --pattern "file*.doc" --volname VOL1

    NOTE:In the preceding example, the purge operation is performed on a file if the file is of pattern "file*.doc" and is older than 250 days.

  • To set purge configuration for file patterns "abc*.txt" and "pqr*.pdf" with the pattern-age of 2 hours for the volume VOL1:

    sputil --purge --set --pattern "abc*.txt/pqr*.pdf" --pattern-age "2h" --volname VOL1

    NOTE:In the preceding example, the purge operation is performed on a file if filename matches either of the patterns “abc*.txt” or “pqr*.pdf” and is older than 2 hours.

  • To set purge configuration for a file pattern "abc*.txt" with the pattern-age of 100 seconds and file patterns "pqr*.pdf" and "xyz*.docx" with pattern-age of 5 days for the volume VOL1:

    sputil --purge --set --pattern "abc*.txt" --pattern-age "100s" -pattern "pqr*.pdf/xyz*.docx" -pattern-age "5d" --volname VOL1

    NOTE:In the preceding example, a file is purged if either of the following conditions is met:

    • Filename matches the pattern “abc*.txt” and is older than 100 seconds.

    • Filename matches the pattern “pqr*.pdf” or “xyz*.docx” and is older than 5 days.

  • To set purge configuration for a file pattern "abc*.txt" with the pattern-age of 200 minutes and file patterns "pqr*.pdf" and "xyz*.docx" with default pattern-age for the volume VOL1:

    sputil --purge --set --pattern "abc*.doc" --pattern-age "200m" -pattern "pqr*.pdf/xyz*.docx" --volname VOL1

    NOTE:In the preceding example, a file is purged if either of the following conditions is met:

    • Filename matches the pattern “abc*. doc” and is older than 200 minutes.

    • Filename matches the pattern “pqr*.pdf” or “xyz*.docx”.

  • To modify for a file pattern "file*.txt" with the pattern-age of 5 days for a volume VOL1 to pattern-age of 10 days:

    sputil --purge --set --pattern "file*.txt" --pattern-age "10d" --volname VOL1

  • To clear a pattern "file*.doc" and “abc*.txt”for volume VOL1:

    sputil --purge --clear --pattern "file*.doc/abc*.txt" --volname VOL1

  • To clear all pattern for volume VOL1:

    sputil --purge --clear --all-pattern --volname VOL1

  • To execute the purge operation based on the configurations that have been preset:

    sputil --purge --exec

  • To execute the purge operation for VOL1:

    sputil --purge --exec -v VOL1

  • To display the statistical information:

    sputil --purge --exec --dry-run --list-files

    This command displays only statistical information. It does not perform the purge operation.

NOTE:The pool name and volume name cannot be specified together in a single command.