Solved

Linked directories

Posted on 2006-07-18
12
250 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
12 Comments
 
LVL 6

Expert Comment

by:bira
Comment Utility
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
Comment Utility
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
Comment Utility
can you post the result of
ls -l   /u01/app/sct/banpprd/ssa/dataload/interfaceIN/finance/wurr725/wurarsi

?
0
 

Author Comment

by:Jack Seaman
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 6

Accepted Solution

by:
bira earned 43 total points
Comment Utility
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
Comment Utility
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
Comment Utility
yes
0
 
LVL 6

Assisted Solution

by:JJSmith
JJSmith earned 41 total points
Comment Utility

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 39

Assisted Solution

by:noci
noci earned 41 total points
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now