How to create symbolic link with alias name


#1

I would like to create symbolic link to directory with alias name.

Source directory : /opt/WebSphere/7.0/
Target Directory : /opt/middleware/websphere/70
Alias name: AppServer
Desired directory after creating link : /opt/WebSphere/7.0/AppServer

For e.g. This is how I would do in Linux/Unix

1. cd /opt/WebSphere/7.0/
2. ln -fs /opt/middleware/websphere/70 AppServer

When I referred Chef resource for link, it is something like this

link “/opt/WebSphere/7.0/” do
to "/opt/middleware/websphere/70"
link_type :symbolic
action :create**
end

How do I mention “AppServer” alias in this.
/opt/WebSphere/7.0/AppServer (where AppServer is symlink alias)


#2

You can do the Linux command in a single line, and that should also show you the solution to your question:

ln -fs /opt/middleware/websphere/70 /opt/WebSphere/7.0/AppServer

Correspondingly, with the link resource:

link “/opt/WebSphere/7.0/AppServer” do
** to “/opt/middleware/websphere/70” **
** link_type :symbolic**
** action :create**
end

Kevin Keane
Whom the IT Pros Call
The NetTech
760-721-8339
http://www.4nettech.com
Our values: Privacy, Liberty, Justice
See https://www.4nettech.com/corp/the-nettech-values.html


#3

Thanks :slight_smile: This is perfect !