duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] [patch] add command 'remove-all-but-n-full'


From: Peter Schuller
Subject: [Duplicity-talk] [patch] add command 'remove-all-but-n-full'
Date: Sat, 27 Oct 2007 13:02:44 +0200
User-agent: Mutt/1.5.16 (2007-06-09)

Kenneth - do you want patches submitted through savannah directly
(noticed patches go through that system) or should one keep posting to
the list?

Attached is a patch to add a 'remove-all-but-n-full' command that
removes backups older than the time of the nth most recent backup.

Motivation:

In certain situation it is more interesting to deal with full backup
sets than time periods, such as if you are trying to save space and
only keep one full + incrementals at a time.

My particular use case is that I use duplicity to backup rdif-backup
archives, so I already have the history and only want a single copy
for offline backup.

Command line interface:

I did not add an additional time format (like rdiff-backup's B suffix
to indicate a number of incremental backups) for the following two
reasons:

  (1) I could not see a good way to do that without either very dirty
      hacks, or a larger re-working of duplicities command line parsing
      and time handling. The reason being that the mapping from a
      full backup relative specifiction to a point in time requires
      information from the backup collection, meaning it cannot nicely
      be done during command line parsing.

  (2) I am not entirely convinced that I would prefer to have it as a
      time format to begin with

So I ended up with a separate remove-all-but-n-full command.

Implementation:

collections.get_last_full_backup() didn't really do what the name
implied. I changed its name to get_last_backup_chain() and implemented
it in terms of the new get_nth_last_backup_chain().

To handle the None special case I added get_last_full_backup_time()
which does what the old get_last_full_backup() did, along with
get_nth_last_full_backup_time().

A new global keep_chains was added to contain the number of chains to
keep when this command is used.

-- 
/ Peter Schuller

PGP userID: 0xE9758B7D or 'Peter Schuller <address@hidden>'
Key retrieval: Send an E-Mail to address@hidden
E-Mail: address@hidden Web: http://www.scode.org

Attachment: duplicity-removeallbutn.patch
Description: Text Data

Attachment: pgpOFHkufGyCO.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]