Bacula-users

Re: [Bacula-users] How does Bacula back-up files?

2011-05-13 08:52:50
Subject: Re: [Bacula-users] How does Bacula back-up files?
From: Konstantin Khomoutov <flatworm AT users.sourceforge DOT net>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 13 May 2011 16:49:37 +0400
On Fri, 13 May 2011 05:32:05 -0700
obviously <bacula-forum AT backupcentral DOT com> wrote:

> I have a question I can't solve...
> 
> The is the situation:
> 
> I create a file with: dd if=/dev/urandom of=test.bin bs=10M count=300
> This gives me a file of 3GB.
> I check it's MD5 with md5sum test.bin
> 
> I clear my cache with echo 3 > /proc/sys/vm/drop_caches.
> 
> I check my chache with free -m.
> 
> I start a backup with Bacula of only 1 file, namely test.bin
> 
> Again, I flush the cache and when the back-up job is starting I
> remove the test.bin file on the server.
> 
> And Bacula doens't react at all, it keeps backing up the file like it
> is still there.
> 
> The backup finishes with no warnings, even it is removed during the
> backup.
> 
> I restore the test.bin file from tape and checks the md5 of it, and
> strangely the md5sum is the same... 
> 
> So my question, how does Bacula do this? Cause I remove the file
> during the backup and flush the cache frequently...
> 
> I hope you guys understand my q, my english is realy bad :) excuse
> me...

On POSIX, any file descriptor representing an opened file is treated
by the OS kernel as a link to that file's data, so when you remove a
file which is opened by at least one process, the unlink() syscall
results in removing that file's entry from the directory it was located
in, but the file's inode and hence its data are still on disk until the
file is closed and the last reference to it is hence lost.

This idiom is even used to create temporary files: a process creates
a temporary file using mkstemp() or something like this and them
immediately removes this file while still keeping a file descriptor on
it.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users