Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Linked directories

Posted on 2006-07-18
12
Medium Priority
?
260 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 172 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 164 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 164 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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
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…
Suggested Courses
Course of the Month11 days, 1 hour left to enroll

885 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