Solved

Linked directories

Posted on 2006-07-18
12
256 Views
Last Modified: 2010-04-21
I'm trying to create a symbolic link between one directory and another.
ln -s /u04/dataload/interfaceIN/finance/wurarsi
       /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725

The "/u04/dataload/interfaceIN/finance/wurarsi" directory is where the datafiles will physically exist, but the directory "/u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725" is where the program will be looking for the files.

Is this correct?  I am a little confused about destination/target terms with the link commad.

Also, is it correct to assume that after this command is run, when new files are placed in "/u04/dataload/interfaceIN/finance/wurarsi" directory, they will be linked in the directory "/u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725"?

My environment is a Sunfire 280R, with Solaris 9.

I posted this question a few months back.  Wasn't able to get it working then.
What are the commands to make this work?
Thanks!
0
Comment
Question by:Jack Seaman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 6

Expert Comment

by:bira
ID: 17131472
according to ln man page,

ln [ -f ] [ -s ] Source [ Target ]


the in your link

ln -s /u04/dataload/interfaceIN/finance/wurarsi
       /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725

/u04/dataload/interfaceIN/finance/wurarsi represents
where the files realy are, and
/u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725 is the symbolic link

0
 

Author Comment

by:Jack Seaman
ID: 17132118
When I issue the command:
ln -s /u04/dataload/interfaceIN/finance/wurarsi
       /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725

I get the following error:
ln: cannot create
    /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725/wurarsi
                       : File exists

I've tried linking before.  The wurarsi is a directory not a file.
0
 
LVL 6

Expert Comment

by:bira
ID: 17132423
can you post the result of
ls -l   /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725/wurarsi

?
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:Jack Seaman
ID: 17133181
Here you are.  I did the one you asked for and the one above

# ls -l   /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725/wurarsi
total 0

# ls -l   /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725
total 2
drwxr-xr-x   2 banner   banner       512 Apr 19 16:06 wurarsi
0
 
LVL 6

Accepted Solution

by:
bira earned 43 total points
ID: 17133721
first you should remove this :

      /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725


 then recreate the link:

ln -s /u04/dataload/interfaceIN/finance/wurarsi
       /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725

0
 

Author Comment

by:Jack Seaman
ID: 17133808
the proper way to remove the link is?

rm /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725
0
 
LVL 6

Expert Comment

by:bira
ID: 17133836
yes
0
 
LVL 6

Assisted Solution

by:JJSmith
JJSmith earned 41 total points
ID: 17134517

rm  -r  /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725

ln -s /u04/dataload/interfaceIN/finance/wurarsi  /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725


As a memory jogger I like to think of the ln arguments as LIVING and REQUIRED

ie the first argument is the thing that exists and the second argument is the thing I require: - then my memory is jogged by LEFT and RIGHT for LIVING and REQUIRED - next time I use the command.

Symbolic linking (ln -s) is simply creating a 'named' pointer to an existing directory/file.

2 things to note:

Symbolic links can point accross to other file systems - whereas hard link - (just 'ln') must be made within the same file system.

Symbolic links can point to directories - hard links can't.

An important note:

Removing a file or directory that a symbolic link points to - will result in an error when the symbolic link is used for access.


Hope this helps
JJ


Hope that helps
JJ
0
 
LVL 40

Assisted Solution

by:noci
noci earned 41 total points
ID: 17141994
if gnu ln is available then

ln -ns .../wurarsi .../wurr725

might have prevented this creating the wurarsi within the target all together.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question