[Box Backup] lazy and snapshot together, file formats and files changing often

Chris Wilson boxbackup@fluffy.co.uk
Fri, 16 May 2008 23:17:30 +0100 (BST)


Hi Louis,

On Fri, 16 May 2008, Louis-Dominique Dubeau wrote:

> > The only difference between lazy and snapshot modes is that in lazy 
> > mode, bbackupd automatically performs a sync at regular intervals, 
> > whereas in snapshot mode, it only does so when asked. You can run in 
> > lazy mode and request snapshot syncs whenever you want.
> 
> I am not clear on how I can achieve this.  I tried *not* changing my 
> .conf file (that is, my conf is still set for lazy backups) and issuing:
> 
> $ sudo bbackupctl sync
> 
> But I still see files missing from the store when I check with 
> bbackupquery.

Snapshot mode does not force all files to be backed up. The same rules 
about MinimumFileAge, MaxUploadWait, etc. are still observed. You could 
argue that this is a bug.

> However, if I create a new config to do a snapshot, tell the daemon to 
> reload its config and then issue bbackupctl sync, then the snapshot goes 
> through.  So if I want to do a sync once every day, I need every day to 
> switch the configuration from lazy to snapshot, issue a sync command, 
> and then switch the configuration back from snapshot to lazy?

Not at all, you can and should leave it in lazy mode. Probably all that 
happened is that the files became old enough while you went through the 
process of changing the config that they were backed up anyway.

> I'll just have to figure out how I want to handle the possibility of 
> inconsistency.  The way I currently do backups, I log out from KDE, 
> create an LVM snapshot of my home, log back into KDE and use some 
> home-baked glue script to start rsync to backup from the LVM snapshot 
> instead of my actual home.  When the backup is done I destroy the 
> snapshot.

You could do something similar by configuring the bbackupd NotifyScript to 
create a snapshot before starting the sync, delete it afterwards, and back 
up the snapshot instead of your home. Lazy backups could still be 
inconsistent, but if you log yourself out before running the snapshot 
sync, it would be consistent.

If you do it this way, then at least your backups are all 
crash-consistent, in other words what you have is the exact state that the 
files would be in if the system crashed at that point. Since most 
applications are designed to at least maintain crash-consistency (in order 
to recover after a system crash) this should be consistent enough for most 
purposes.

Cheers, Chris.
-- 
_____ __     _
\  __/ / ,__(_)_  | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Ruby/Perl/SQL Developer |
\ _/_/_/_//_/___/ | We are GNU : free your mind & your software |