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

Re: How to find a deleted file amongst many archives



On 11/05/15 13:19, Quinn Comendant wrote:
> On Thu, 5 Nov 2015 13:01:18 -0500, Quinn Comendant wrote:
>> Is there a way to search all archives to find "the most recent file that 
>> exist(s|ed) at the specified path"?
> 
> Just to avoid anyone giving the obvious answer: I suppose I can always wrap
> `while` loops around `tarsnap --list-archives` and `tarsnap -t -f
> $ARCHIVENAME` with a combination of `grep $FILENAME` and `tail -1`.

You got there before me.  Of course, assuming the file disappeared at one
point and did not reappear again later, you could do a binary search instead
of a linear search here.

> Is that the best strategy, or is there a built-in command that does this
> more elegantly (there don't appear to be)?

There's no built-in way to do this.  Due to tarsnap's encryption, there's no
way to "index" the archives, so any built-in command would just do what you
can do manually anyway; there didn't seem much point.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid