[OpenAFS] Force client to cache directory
Marc Dionne
marc.c.dionne@gmail.com
Mon, 4 Jan 2010 13:14:09 -0500
On Mon, Jan 4, 2010 at 1:00 PM, Christof Hanke
<christof.hanke@rzg.mpg.de> wrote:
> Am Montag, 4. Januar 2010 16:56:44 schrieb Gilles Martin:
>> Hello,
>>
>> I was wondering if it's possible to force caching a specific directory o=
n a
>> client. For example by running a cron job regularly. The aim of this is
>> =A0that the client in case of server problem has an up to date version o=
f the
>> =A0files in its cache. I didn't find any command in the cache manager th=
at
>> =A0does this, it's only possible to clear the cache, I would like to do =
the
>> =A0opposite, fill the cache !
>>
> Well, why not do something like an "ls -l" as a cron-job on the client ?
> You just have to make sure, in case the ls-cmd is hanging, that you don't=
call
> it again.
>
> Calling this script by cron should work (not tested) :
>
> #!/bin/sh
>
> LS_CMD=3D"ls -l /afs/path"
> if [ `ps -eaf | grep -v grep | grep -c "$LS_CMD"` =3D=3D 0 ]; then
> =A0$LS_CMD
> fi
>
>
> Cheers,
>
> Christof
But that wouldn't keep the file contents up to date, would it?
There's been some discussion about implementing an "fs [un]pin"
feature (see http://www.dementia.org/twiki/bin/view/AFSLore/OpenAFSCachePin=
ning)
in conjunction with disconnected mode, but I don't know if there's
been any recent progress.
Marc