On Mon, 23 Jan 1995, Joe Ramus wrote:

> Date: Mon, 23 Jan 95 10:06:09 PST
> From: Joe Ramus <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED], [EMAIL PROTECTED]
> Subject: Re: Volume to mount point conversion
>
>
> Depending on the size of your AFS file space and the frequency of
> creating new volumes, you could use our method.
> We do this once a month.
>
> Do a recursive find in your AFS space and get the pathname for each
> directory.   For each directory name, execute the command:
>   fs lsmount <directory-name>
>
> This will give you the path name for each mount point.
> Save this info for use in answering your query.
>
> Here is a script that we use.
> ----------------------------------------------------------------------
>
> #!/usr/local/bin/perl
>
> eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
>       if $running_under_some_shell;
>
> require "find.pl";
>
> # Traverse desired filesystems
>
> &find('/afs/es.net');
>
> exit;
>
> sub wanted {
>     (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
>     -d _ &&
>     system( "/usr/afsws/bin/fs lsmount -dir $name" );
> }

I would suggest to use this instead of the above:

sub wanted {
      (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
      $nlink >= 2 &&
      system("/usr/afsws/bin/fs lsmount -dir $name");
}

With this you will avoid going through symbolic links... and avoid
possible endless loops.

"-d $_" will return '1' for a symbolic linked directory.

>
> ----------------------------------------------------------------
> | Joe Ramus  NERSC Livermore  (510) 423-8917   [EMAIL PROTECTED] |
> ----------------------------------------------------------------
>

--
Juan Leon                           IBMIPNET: v2jleon@mhv
UNIX Distributed Computing          Internet: [EMAIL PROTECTED]
IBM ISSC Solution Center-Northeast  Phone: (914) 435-6630 Tie: 295-6630

                  "Limits exist only in your mind"



Reply via email to