Thu Jan 18 00:43:47 EST 2001
Thanks for the quick reply.
With amanda 2.4.2 files that go to the holding disk first have a .tmp
appended to them. The file is then renamed to what it appears as in
the amdump file. What I currently do is :
while ($true) {
unless (-e $from) {
sleep ($nap);
next;
}
$true = 0;
}
using Time::HiRes qw(sleep); which allows me to set $nap to 0.15
seconds. Hence, I wait for the file renaming to take place. Without
using this sleep, is there a better way of monitoring the holding disk
directory, so as to link any new files to the archive directory. I
heard that in FreeBSD kqueue(2) could be used to monitor a directory,
so that one would be notified of any new files created. Is there
something along these lines that could be done.
My main worry is that small change done to one small file, hence a
very tiny level 1, that gets dumped, written to tape, and removed from
the holding disk, before it ever shows up in the amdump log.
Is my above concern warranted?
Andrew.
On Thu, Jan 18, 2001 at 12:29:48AM -0500, John R. Jackson wrote:
> >Not being C coders, this is implemented in perl, hence I am worried of
> >the race condition where the file is dumped and removed from the
> >holding disk before we get a chance to copy it over.
>
> I'd create another directory in the holding disk area parallel to the
> real holding disk, then hard link to the holding disk image. Use the
> hard link to do your copy. If Amanda removes it's link before you are
> done, no big deal. When both links are gone, the space will be released.
>
> See the "mkdir" and "link" Perl calls.
>
> Watch out for holding disk chunking, if you're using that. It will
> create multiple files and you'll need to deal with all of them (and they
> are not listed in the amdump log file).
>
> >Andrew.
>
> John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]