jlink, jtool link

You can use jlink to link files to jobs, so that they appear as output of the process in Redwood Server. On operating systems that support symbolic and hard links, you can also use jlink to create them. This is especially useful on Windows, where the standard tools may be insufficient or missing.

Note: For installation instructions, see jtool.

Syntax

Copy
jlink [-h|-?|-help] [-l <loglevel>] [-f <logfile>] -j|-job-context [-[no]deletewithJob]
      [-charset <charset>] <file> [<shortname>]

Argument Description
-h, -?, -help Shows the help.
-l <loglevel> Sets the log level.
-f <logfile> Logs to a file instead of stdout and stderr.
-j, -job-context Gets the environment from the job context.
-[no]deletewithjob Determines if the file should be deleted with the process. The no prefix leaves the file intact after process deletion (the default).
-charset <charset> Explicitly sets the file's character set.
-hard Creates an OS hard link instead of a link file.
-sym Create an OS symbolic link instead of a link file.
-copy Copies <file> to <target>.
-move Moves <file> to <target>.
-rm Removes <file>.
-rmdir Removes directory <file>.
<file> The path to the file to attach to the process.
<shortname> The short name used in RunMyJobs.

Note that the file should not itself reside in the TMPDIR directory, because all files in that directory will be deleted when the process finishes.

For more information, see The Environment of Platform Processes.

Notes on -hard and -sym

On UNIX, these options are supported and equivalent to calling ln and ln -s. On Windows, they will check whether the OS supports the option, and log a warning if the OS is not recent enough. Hard links on Windows are supported on the NTFS file systems starting with Windows 2003. Symbolic links are supported on the NTFS file systems starting with Windows 2008. Note that normal UAC privileges mean that normal users and administrators not running in elevated mode are unable to create symbolic links.

Example

Note: To perform the tasks below, you must have the address of a valid mail server from which you are allowed to send email.

  1. Create a Process Definition of type CMD named CMD_LinkFile with the code below, and leave all other process properties at their defaults.
  2. Create a Chain Definition named JC_LinkFileAndSend.
  3. Add a Step and a Chain Process running CMD_LinkFile.
  4. Add a second Step and a Chain Process running System_MailSend with the parameter values below.
  5. Submit the Chain and check your mail.
Copy
rem Windows command process that attaches an external log file to a process with a short name
jlink -nodeletewithjob %windir%\setuplog.txt setup.log

Note: You can change %windir%\setuplog.txt to an existing file in your file system. However, if you change setup.log, do not forget to adapt the code above.

The parameters for the process of the second Step of the Chain Definition JC_LinkFileAndSend are shown below.

Parameter Expression
To <your email address>
Subject Example file
Text An example file sent to me by RunMyJobs.
Relative job Step 1, Job 1
Job file ntuser.ini
Server <your SMTP server>
From <your email address>