Solved

Linked directories

Posted on 2006-07-18
12
251 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
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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

863 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

22 Experts available now in Live!

Get 1:1 Help Now