7/23/09

Symbolic links

Sometimes, in the process of WebSphere, IHS Administration, it may require you to create symbolic links. This is the procedure.

ln is the command to create symbolic links.
$man ln
User Commands ln

NAME
ln - make hard or symbolic links to files

SYNOPSIS
/usr/bin/ln [-fns] source_file [target]

/usr/bin/ln [-fns] source_file... target

/usr/xpg4/bin/ln [-fs] source_file [target]

/usr/xpg4/bin/ln [-fs] source_file... target

DESCRIPTION
In the first synopsis form, the ln utility creates a new
directory entry (link) for the file specified by
source_file, at the destination path specified by target. If
target is not specified, the link is made in the current
directory. This first synopsis form is assumed when the
final operand does not name an existing directory; if more
than two operands are specified and the final is not an
existing directory, an error will result.

In the second synopsis form, the ln utility creates a new
directory entry for each file specified by a source_file
operand, at a destination path in the existing directory
named by target.
..............................


Example -
Developers wanted to have a look at SystemOut.log and SystemErr.log. They dont have uid on the box. So, I need to create a web link to this through HTTP Server.
I did like this.
I have created a document root called logs.
/logs
I created symbolic links to SystemOut.log and SystemErr.log like this
ln -s source destination
This creates a softlink *from* a file to a *file*
$ln -s /path/to/appserver/profiles/profilename/logs/servername/SystemOut.log SystemOut.log
$ln -s /path/to/appserver/profiles/profilename/logs/servername/SystemErr.log SystemErr.log
This created me two files SystemOut.log and SystemErr.log under /logs
if I ls -ltr on /logs, I get this list
SystemOut.log -> /path/to/appserver/profiles/profilename/logs/servername/SystemOut.log
SystemErr.log -> /path/to/appserver/profiles/profilename/logs/servername/SystemErr.log

Now, I have created a html file, say, index.html with hyperlinks like this -
Server Logs
< A HREF="SystemOut.log">SystemOut< / A>< br />
< A HREF="SystemErr.log">SystemErr< / A>

No comments: