[Borgbackup] Why does 'borg extract' overwrite identical (existing) files?

Thomas Waldmann tw at waldmann-edv.de
Sun Nov 1 16:28:29 EST 2020


> Next I ran the 'borg extract' command on the latest archive (the one I just created) and expected nothing to happen,

Reality sometimes does not conform to personal expectation. :-)

borg behaves like other unix archivers (think of tar x or unzip) and 
extracts to current directory (not: to original location).

also it stores relative pathes into the archive (see borg list).

There is nice documentation, please read it.

> assuming that identical files, in identical locations would just be skipped.

As the expectation from borg is that you extract into an empty 
directory, it has no complicated / complete mechanisms to update a 
non-empty directory structure. "extract" is NOT "sync".

What is does is to create missing intermediate directories and kill all 
files which are "in the way", but not more than that.

There is a ticket about the idea of a more advanced "extract", but it 
was not addressed yet.

> May I kindly ask a short hint as to the motivation behind that design choice?

Simplicity. extract is extract, not "sync to archive state".

> What I am looking for is sth. similar to rsync's approach with regard to avoiding the transfer of available files.

borg is not rsync, neither it is a sync tool in general - it's a backup 
tool.

Locate that ticket for more details, it is not trivial.

-- 
GPG ID: 9F88FB52FAF7B393
GPG FP: 6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393


More information about the Borgbackup mailing list