Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linked directories

Posted on 2006-07-18
12
Medium Priority
?
258 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
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.

 

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

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.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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…
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…
Suggested Courses

715 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