Skip to end of metadata
Go to start of metadata

Description of JobSchedulerCopyFile - Copies one or more files

This job copies one or more files. Examples:

Parameter used by JobSchedulerCopyFile

Parameter: count_files

If this parameter is set as " true " the number of copied files is returned in the order parameter " scheduler_SOSFileOperations_file_count ".

This parameter is only available for order jobs.
The default value for this parameter is false.

Parameter: create_dir

If enabled target_file is checked for existence.
If target_file does not exist target_file will be created as a directory.
The default value for this parameter is false.

Parameter: file_spec

Regular expression for file filtering. Default behaviour is CASE_INSENSITIVE.Only effective if source_file is a directory.
The default value for this parameter is .{*}.

Parameter: gracious

Enables or disables error messages that are caused by a nonexistent file or directory being specified with source_file .

Valid values: false, 0, off, no, n, nein, none , true, 1, on, yes, y, ja, j and all

The following rules apply when source_file contains an incorrect value: GRACIOUS Standalone-Job Order-Job false, 0, off, no, n, nein, noneerror log,
Task errorerror log,
set_state errortrue, 1, on, yes, y, ja, jno error log,
Task successno error log,
set_state errorallno error log,
Task successno error log,
set_state success
The default value for this parameter is false.

Parameter: max_file_age

Maximum fileage
Files are only included for further operations if their file age is less or equal. Older files are not copied.

Possible values:
0 (disabled)
seconds
hours:minutes
hours:minutes:seconds
The default value for this parameter is 0.

Parameter: max_file_size

Maximum filesize
Files are only included for further operations if their file size is less or equal. Larger files are not copied.

Possible Values:
-1 (disabled)
number (Byte), e.g. 40
numberKB, e.g. 5KB (case insensitive)
numberMB, e.g. 20MB (case insensitive)
numberGB, e.g. 10GB (case insensitive)
The default value for this parameter is -1.

Parameter: min_file_age

Minimum fileage
Files are only included for further operations if their file age is greater or equal. Newer files are not copied.

Possible values:
0 (disabled)
seconds
hours:minutes
hours:minutes:seconds
The default value for this parameter is 0.

Parameter: min_file_size

Minimum filesize
Files are only included for further operations if their file size is greater or equal. Smaller files are not copied.

Possible Values:
-1 (disabled)
number (Byte), e.g. 40
numberKB, e.g. 5KB (case insensitive)
numberMB, e.g. 20MB (case insensitive)
numberGB, e.g. 10GB (case insensitive)
The default value for this parameter is -1.

Parameter: overwrite

Allows or prevents overwriting of already existing files.
The default value for this parameter is true.

Parameter: recursive

The default value for this parameter is false.

Parameter: replacement

String for replacement of the replacing expression.
If multiple groups are to be replaced then one replacement string per group must be specified. These strings are separated by a semicolon ";":
replacement: aa;filename;bbSupports masks for substitution in the file name with format strings that are enclosed by [and] . The following format strings are supported:

  • date format date format must be a valid Java data format string, e.g. yyyyMMddHHmmss , yyyy-MM-dd.HHmmss etc.
  • filename Will be substituted by the original file name.
  • lowercase Will be substituted by the original file name with all characters converted to lower case.
  • uppercase Will be substituted by the original file name with all characters converted to upper case.

Requires the replacing parameter to be specified.

Parameter: replacing

Regular Expression for filename replacement with replacement .
If the expression matches on the filename the found groups are replaced.
a)
"capturing groups" are used for replacement. Only the content of the capturing groups is replaced.
Replacements are separated by a semicolon ";". Example:

Input file: 1abc12def123.txt
Output file: AabcBBdefCCC

b)
If no capturing groups are specified the entire match is replaced. Example:

Input file: Hello_World.txt
Output file: 1234_World.txt
Requires that the replacement parameter is specified.

Parameter: skip_first_files

The number of files are removed from the beginning of the set resulting by min_file_size, min_file_age etc. These files are excluded from further operations.

The result set is sorted according to the used constraining parameters:
+ min_file_age, max_file_age: in ascending order by date of last modification, the newest file first.
+ min_file_size, max_file_size: in ascending order by file size, the smallest file first.
+ if parameters for file age as well as file size are given the set is sorted by file age.

Only either skip_first_files or skip_last_files is allowed to be set at one time.
The default value for this parameter is 0.

Parameter: skip_last_files

The number of files are removed from the end of the set resulting by min_file_size, min_file_age etc. These files are excluded from further operations.

The result set is sorted according to the used constraining parameters:
+ min_file_age, max_file_age: in ascending order by date of last modification, the newest file first.
+ min_file_size, max_file_size: in ascending order by file size, the smallest file first.
+ if parameters for file age as well as file size are given the set is sorted by file age.

Only either skip_first_files or skip_last_files is allowed to be set at one time.
The default value for this parameter is 0.

Parameter: source_file

Source file or directorySupports substitution of job parameter names with their value if the job parameter name is enclosed by %  and  % .
Example: <param name="source_file" value"%scheduler_file_path%" />
During the job runtime the parameter source_file contains the value of the job parameter scheduler_file_path . Using Directory Monitoring with File Orders the job parameter scheduler_file_path contains automatically the path of the file that triggered the order.
This parameter is mandatory.

Parameter: target_file

Target file or directoryIf the target_file is not specified, then the dirctory path of source_file is used as target.Supports masks for substitution in the file name with format strings that are enclosed by and  . The following format strings are supported:

  • date format date format must be a valid Java data format string, e.g. yyyyMMddHHmmss , yyyy-MM-dd.HHmmss etc. Example: <param name="target_file" value"sample/helloyyyyMMdd.txt" /> On 2050-12-31 the parameter target_file contains the value "sample/hello20501231.txt" .
  • directory Is substituted by the directory path of source_file .
  • index Is substituted by the directory path of source_file up to or from the directory number index . index can be a positive number, a negative number or 0.
    Example: source_file is "aaa/bbb/ccc/ddd/" (it contains 4 directories) 2 returns "aaa/bbb" -3 returns "bbb/ccc/ddd" 0 or -0 return always the complete path. 5 or -12 return the complete path in this example.