[OpenAFS] 'replication'

Neulinger, Nathan nneul@umr.edu
Fri, 30 Aug 2002 13:01:54 -0500


Why are you doing a vos release if the volume hasn't changed?

Here's a snippet of a script I use to regularly release certain vols:

sub AFS_ReleaseVolume
{
        my ($volume,%options) =3D @_;
        my ($info);
        my ($rwtime, $rotime);
        my $needrel =3D 0;
        my $needforce =3D 0;
       =20
        $info =3D `/usr/afsws/etc/vos e $volume -noauth`;
        if ( $info =3D~ /Last Update ... (...) (..) (..):(..):(..)
(....)/m )
        {
                $rwtime =3D sprintf("%.4d%.2d%.2d%.2d%.2d%.2d",
                        $6, $months{lc $1}, $2, $3, $4, $5);
                #print "rw tstamp =3D $rwtime\n";
        }
        if ( $rwtime =3D=3D 0 )
        {
                return "Unable to retrieve volume RW info.";
        }

        $info =3D `/usr/afsws/etc/vos e $volume.readonly -noauth`;
        while ( $info =3D~ /Last Update ... (...) (..) (..):(..):(..)
(....)/gm )
        {
                $rotime =3D sprintf("%.4d%.2d%.2d%.2d%.2d%.2d",
                        $6, $months{lc $1}, $2, $3, $4, $5);
                #print "ro tstamp =3D $rotime ($rwtime)\n";
                if ( $rwtime >=3D $rotime )
                {
                        $needrel =3D 1;
                }
                if ( $info =3D~ /old release/mi )
                {
                        $needforce =3D 1;
                }
                if ( $info =3D~ /not release/mi )
                {
                        $needrel =3D 1;
                }
        }

        my @cmd =3D ();
        if ( $options{"force"} || $needforce)
        {
                @cmd =3D ("vos", "release", $volume, "-verbose", "-f");
        }
        elsif ( $needrel )
        {
                @cmd =3D ("vos", "release", $volume, "-verbose");
        }
        else
        {
                return undef;
        }

        if ( ! $options{showoutput} )
        {
                my ($seq, $basepath);

                ($seq,$basepath) =3D &LOG_CreateEntry;
                &LOG_AddData($seq, "application", "afs-vos-release");
                &LOG_AddData($seq, "data.volume", $volume);

                &LOG_Exec("$basepath.output", $TOOL_AUTH, @cmd);
        }
        else
        {
                system($TOOL_AUTH, @cmd);
        }
        return undef;
}

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@umr.edu
University of Missouri - Rolla         Phone: (573) 341-4841
Computing Services                       Fax: (573) 341-4216


> -----Original Message-----
> From: Turbo Fredriksson [mailto:turbo@bayour.com]=20
> Sent: Friday, August 30, 2002 12:56 PM
> To: openafs-info@openafs.org
> Subject: Re: [OpenAFS] 'replication'
>=20
>=20
> >>>>> "Dave" =3D=3D Dave McMurtrie <dgm+@pitt.edu> writes:
>=20
>     >> First of, I'm running both the server and client on only one
>     >> machine, so maybe this is the problem.
>=20
>     Dave> Just my nickel worth, but if the data is changing that
>     Dave> often, and you're running your cell on a single machine
>     Dave> anyway, maybe it's not worth your trouble to replicate these
>     Dave> volumes.
>=20
> The plan is to have more. I just don't have the money right now...
>=20
> The thing is, it DOESN'T change that often. Replicating the public.*
> volumes (public.ftp(.Linus,.windows) and public.web) hardly changes
> at all, still it want's to do a 'complete release'...
>=20
> IF I move the AFS volumes to it's separate server(s), and only have
> the current machine as a slave, will the volumes still be locked
> (when doing backup/replicated)?
>=20
> Is the lock on the server or the client side?
>=20
> --=20
> Honduras Cuba jihad Waco, Texas class struggle South Africa Iran
> attack Khaddafi explosion bomb DES nuclear Cocaine SDI
> [See http://www.aclu.org/echelonwatch/index.html for more about this]
> _______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info
>=20