Difference between revisions of "OS4X plugin os4xplugin filemove archive"

From OS4X
Jump to navigation Jump to search
(Created page with "Category:Plugins == Puropose == Move all files of a job into a defined target archive directory. If no target directory is configured, the plugin skips its execution. ==...")
 
 
Line 50: Line 50:
 
== Examples ==
 
== Examples ==
 
All examples rely on an outgoing job 76 from and to the company "c-works"
 
All examples rely on an outgoing job 76 from and to the company "c-works"
  /opt/os4x/tmp/%r/os4x_job_%j/
+
  /mnt/archive/%r/os4x_job_%j/
 
renders to:
 
renders to:
  /opt/os4x/tmp/c-works/os4x_job_76
+
  /mnt/archive/c-works/os4x_job_76
  
 
----
 
----
  /opt/os4x/tmp/%D/%r/%j
+
  /mnt/archive/%D/%r/%j
 
renders to:
 
renders to:
  /opt/os4x/tmp/outgoing/c-works/76
+
  /mnt/archive/outgoing/c-works/76
  
 
== Return values ==
 
== Return values ==

Latest revision as of 19:10, 15 March 2022

Puropose

Move all files of a job into a defined target archive directory. If no target directory is configured, the plugin skips its execution.

Requirements

  • File /etc/os4x.conf or configuration file pointed to in environment variable $OS4X_CFGFILE. Via the used configuration file, the information are retrieved used by the plugin (such as default configuration etc.).

Configuration

The target directory can be set up to contain variables. These variables are exchanged by runtime information of the OS4X job, in which context the plugin is run.

The usable variables are:

  • %j: job number
  • %d: day of job creation (two digits)
  • %m: month of job creation (two digits)
  • %Y: year of job creation (four digits)
  • %H: hour of job creation (two digits, 24h format)
  • %M: minute of job creation (two digits)
  • %S: second of job creation (two digits)
  • %D: job direction: "incoming" or "outgoing"
  • %r: recipient partner shortname
  • %s: sender partner shortname
  • %t: recipient location name
  • %u: recipient department name
  • %v: recipient first name
  • %w: recipient family name
  • %x: recipient address code
  • %g: sender location name
  • %h: sender department name
  • %i: sender first name
  • %J: sender family name
  • %k: sender address code
  • %e: depending on the job direction, the company shortname of the external communication partner:
    • incoming jobs: sender's company shortname (= "%s")
    • outgoing jobs or undefined job direction: recipient's company shortname (= "%r")
  • %a: ENGDAT Message Reference [UNH0062] (if available, otherwise empty)
  • %b: ENGDAT Document Number [MID1004] (if available, otherwise empty)
  • %y: recipient's username ("unknown" if empty)
  • %l: sender's username ("unknown" if empty)
  • %p: sender partner's event parameter
  • %P: recipient partner's event parameter
  • %Q: depending on the job direction, the event parameter of the external communication partner:
    • incoming jobs: sender's event parameter (= "%p")
    • outgoing jobs or undefined job direction: recipient's company shortname (= "%P")
  • %A: job year (short, two digits)
  • %%: represents the character "%"

Examples

All examples rely on an outgoing job 76 from and to the company "c-works"

/mnt/archive/%r/os4x_job_%j/

renders to:

/mnt/archive/c-works/os4x_job_76

/mnt/archive/%D/%r/%j

renders to:

/mnt/archive/outgoing/c-works/76

Return values

  • 0: everything OK
  • 1: Configfile (/etc/os4x.conf or value of environment variable "OS4X_CFGFILE", read in as file) cannot be found or database unavailable.
  • 2: License error
  • 3: XML parameter file cannot be parsed
  • 4: Files cannot be moved