duplicity-talk
[Top][All Lists]
Advanced

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

Re: [Duplicity-talk] Date override


From: Kenneth Loafman
Subject: Re: [Duplicity-talk] Date override
Date: Thu, 17 Mar 2011 17:41:17 -0500

On Thu, Mar 17, 2011 at 5:29 PM, Nate Eldredge <address@hidden> wrote:
[I sent this yesterday but it didn't seem to make it to the list.  Sorry if this is a duplicate.]

Hello,

I would like to be able to create backups with dates different from the current system date, and am interested in suggestions for adding such a feature.

I have a number of old backups created by hand without duplicity, which I would like to "import" into duplicity for easier management and archival. My plan is to restore each backup and then run duplicity on the unpacked tree.  If possible, I would like to have the backup dates recorded by duplicity match the original backup dates. That way I can use duplicity's -t switch to, say, recover a certain file as it was on June 24, 2006.

I don't need to merge with an existing duplicity backup set, and I can import the backups in chronological order, so I shouldn't need anything fancy.  I just want duplicity to create a backup exactly as it would if the current date were really September 27, 2005 (for instance).  I could temporarily alter the system clock, but that's not very pretty and might disrupt other things on the machine.

I would think it should not be hard to achieve this, but I would welcome any suggestions from anyone familiar with the code base on where would be a good point to inject this.  In particular, I noticed that `genstrtotime' has an optional `override_curtime' arg that perhaps was intended for something like this, though as far as I can tell it is not used anywhere. (I am not a python expert so I could be missing something.)

There is an undocumented option used for testing, --current-time, that you could use for this.  This option takes an integer that represents the time that you want.  The int is a UNIX time() value, i.e. seconds since the epoch, 1/1/1970 at 00:00:00.  So, using the 'date' command, you should be able to convert from a time string to UNIX time.

Be sure to use the most recent version, 0.6.12.

...Ken


reply via email to

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