PingDirectory

File retention recurring task

You can configure a recurring task to remove files in a specified directory that match a given pattern.

You can exclude files that match count-based, time-based, or space-based retention criteria. If any files are to be removed, the oldest files are removed before the most recent file.

If the file name pattern includes a "${timestamp}" element, the timestamp is used to identify the file’s age. If the file name pattern does not include a timestamp, then the file’s age is determined by using the file’s creation time, if available, or the last modified time, if the creation time is not available. If a file’s age cannot be determined, the file is not removed.

If multiple files have the same age, the server uses lexicographic ordering to differentiate between them. Lexicographic ordering is applicable only for files with no retain-file-age property configured or for files that are older than that age. If multiple files do not share the same age, but that age is younger than the retain-file-age value, then those files are retained.

When configuring a file removal task, you must specify at least one of the following properties:

  • retain-file-count

  • retain-file-age

  • retain-aggregate-file-size