Access a remote directory with a different name
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
Re: Access a remote directory with a different name
Twiggy182 wrote:[color=blue]
> 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[/color]
it seems to me that somewhere in apache .conf there's an option "follow
symbolic links" . Maybe that could help ?
--
buffle
Re: Access a remote directory with a different name
Twiggy182 <twiggy182@hotmail.com> wrote:[color=blue]
>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.[/color]
Symlink is going to be your best option here.
[color=blue]
>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[/color]
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.
[color=blue]
>It seems that symbolic link can't help me for that. I tried with
>mounting but I have access problem.[/color]
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 [email]dagon@dagon.net[/email] <http://www.dagon.net/>