OS4X plugin os4xplugin delete specific file

From OS4X
Jump to navigation Jump to search

Purpose

Identify file(s) of a job with regular expression and do the configurable operation:

  • keep
  • delete

Deletion can be done logically (only in the job) or also physically (deleted on the filesystem).

Requirements

  • File /etc/os4x.conf or configuration file in the environment variable $OS4X_CFGFILE. The license file is obtained from the database configured here.

Configuration

Bildschirmfoto 2026-05-12 um 21.05.19.png

  • Regular expression for identifying files: The regular expression (PCRE) used for identifying a file. The rule will be applied to the absolute path of a file.
  • Really delete file from filesystem: If enabled, the file itself is being deleted on the filesystem.
  • Enable debug output: When enabled, more debug output will be printed out.
  • Invert logic: delete all non-matching files:
    • If disabled (default): only files matching the regular expression will be deleted.
    • If enabled: only files NOT matching the regular expression will be deleted.

Return values

  • 0: everything OK
  • 1: number of parameters != 1; Config file /etc/os4x.conf not found; Config in database not readable; license not valid; XML file invalid
  • all others: return value of the "unlink" function. The output on the standard output contains a system-side textual interpretation of the error.