jlink, jtool link
A platform agent tool used to link files to jobs, so that they appear as output of the process in Redwood Server. You can then send these files via email, for example.
On operating systems that support them it can also be used to create symbolic and hard links. This is especially useful on Microsoft Windows, where the standard tools may be insufficient or missing.
Syntax
jlink [-h|-?|-help] [-l <loglevel>] [-f <logfile>] -j|-job-context [-[no]deletewithJob] [-charset <charset>] <file> [<shortname>]
Argument | Description |
---|---|
-h, -?, -help | Show the usage information and exit |
-l <loglevel> | Defaults to ${JCS_LOGLEVEL:-info}, set the logging level; defaults to environment variable ${JCS_LOGLEVEL} or info when the environment variable is not set. |
-f <logfile> | Defaults to ${JCS_LOGFILE:-stderr}, causes logging to be directed to file instead of stderr; defaults to environment variable ${JCS_LOGFILE} or stderr when the environment variable is not set. |
-j, -job-context | Run the command in job-context |
-[no]deletewithjob | Determines if the file should be deleted with the process, the no prefix leaves the file intact after process deletion and is the default. |
-charset <charset> | Explicitly set the characterset that the file is in |
-hard | Create an OS hard link instead of a link file |
-sym | Create an OS symbolic link instead of a link file |
-copy | Copy <file> to <target> |
-move | Move <file> to <target> |
-rm | Remove <file> |
-rmdir | Remove directory <file> |
<file> | The path to the file to attach to the process. |
<shortname> | The short name used in Redwood Server |
Note that the file should not itself reside in the TMPDIR
directory, as all files in that directory will be deleted when the process finishes.
See The Environment of Platform Processes for more information on the environment of process.
Notes on -hard and -sym
On UNIX these options are supported and equivalent to calling ln
and ln -s
. On Microsoft Windows they will check whether the OS supports the option, and log a warning if the OS is not recent enough. Hard links on Microsoft Windows are supported on NTFS file systems starting with Windows 2003. Symbolic links are supported on 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 need to have the address of a valid mail server from which you are allowed to send email.
- Create a process definition of type CMD with the below code, named CMD_LinkFile and leave all other process properties at their defaults.
- Create a chain definition named JC_LinkFileAndSend.
- Add a Step, and a chain process running CMD_LinkFile.
- Add a second step, and a chain process running System_MailSend with the below parameter values.
- Submit the chain and check your mail.
Source for CMD_LinkFile
note
You may change %windir%\setuplog.txt
to an existing file on the file system, however, if you change setup.log
, do not forget to adapt the below parameter.
rem Windows command process that attaches an external log file to a process with a short name
jlink -nodeletewithjob %windir%\setuplog.txt setup.log
Parameters for the process of the second step of the chain definition JC_LinkFileAndSend.
Parameter | Expression |
---|---|
To | <your email address> |
Subject | Example file |
Text | An example file sent to me by Redwood Server |
Relative job | Step 1, Job 1 |
Job file | ntuser.ini |
Server | <your SMTP server> |
From | <your email address> |
note
Please replace <your email address>
and <your SMTP server>
with your real settings, ask your network administrator if in doubt.