Unix administration - Access a remote directory with a different name

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > March 2005 > Access a remote directory with a different name





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Access a remote directory with a different name
Twiggy182

2005-03-21, 6:03 pm

Hi all,

I have a script which needs to access a file to an hardcoded directory
(not my design) on a remote server. This directory is mounted under
the directory /net/[remoteServerName]. This works fine for almost all
the servers this script has to connect to. Except that for one of
them, the file can not be move to the hardcoded directory. So I need a
way to access the file but by using the hardcoded directory.

Ok, let me repeat that with names

I have 2 servers : localServer and remoteServer
Hardcoded file to access : /hard/coded/dir/file.txt
Real location of the file : /other/location/file.txt
Mouting point on "localServer" : /net

So what I need is to be able to access the file from "localServer"
through this directory:
/net/remoteServer/hard/coded/dir/file.txt

For the moment, the only way I can access it is:
/net/remoteServer/other/location/file.txt


It seems that symbolic link can't help me for that. I tried with
mounting but I have access problem.

Anyone has a solution?

Thanks
Max
clément Courbet

2005-03-21, 6:03 pm

Twiggy182 wrote:
> Hi all,
>
> I have a script which needs to access a file to an hardcoded directory
> (not my design) on a remote server. This directory is mounted under
> the directory /net/[remoteServerName]. This works fine for almost all
> the servers this script has to connect to. Except that for one of
> them, the file can not be move to the hardcoded directory. So I need a
> way to access the file but by using the hardcoded directory.
>
> Ok, let me repeat that with names
>
> I have 2 servers : localServer and remoteServer
> Hardcoded file to access : /hard/coded/dir/file.txt
> Real location of the file : /other/location/file.txt
> Mouting point on "localServer" : /net
>
> So what I need is to be able to access the file from "localServer"
> through this directory:
> /net/remoteServer/hard/coded/dir/file.txt
>
> For the moment, the only way I can access it is:
> /net/remoteServer/other/location/file.txt
>
>
> It seems that symbolic link can't help me for that. I tried with
> mounting but I have access problem.
>
> Anyone has a solution?
>
> Thanks
> Max

it seems to me that somewhere in apache .conf there's an option "follow
symbolic links" . Maybe that could help ?

--
buffle
Mark Rafn

2005-03-22, 6:08 pm

Twiggy182 <twiggy182@hotmail.com> wrote:
>I have a script which needs to access a file to an hardcoded directory
>(not my design) on a remote server. This directory is mounted under
>the directory /net/[remoteServerName]. This works fine for almost all
>the servers this script has to connect to. Except that for one of
>them, the file can not be move to the hardcoded directory. So I need a
>way to access the file but by using the hardcoded directory.


Symlink is going to be your best option here.

>I have 2 servers : localServer and remoteServer
>Hardcoded file to access : /hard/coded/dir/file.txt
>Real location of the file : /other/location/file.txt
>Mouting point on "localServer" : /net
>So what I need is to be able to access the file from "localServer"
>through this directory:
>/net/remoteServer/hard/coded/dir/file.txt
>For the moment, the only way I can access it is:
>/net/remoteServer/other/location/file.txt


Yup,
mkdir -p /hard/coded; ln -s /net/remoteServer/hard/coded/dir /hard/coded

You now have real directory /hard/coded, and a symlink from the "dir" it
contains to the "dir" on the server.

>It seems that symbolic link can't help me for that. I tried with
>mounting but I have access problem.


I think symlinks can take care of it, but you can only create symlink
filenames, not full paths. The solution is to fix the use of the hardcoded
path, but failing that, make a real path up to the final dir, and symlink that
to the correct location.
--
Mark Rafn dagon@dagon.net <http://www.dagon.net/>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com