Live data from Hacker News

Duplicity: Encrypted bandwidth-efficient backup

duplicity.us

81–90 of 104 posts

Re: Duplicity: Encrypted bandwidth-efficient backup

#81
post #26
post #21

Earlier quoted context omitted.

Content-addressed backups sound something like how git stores data, is that the best way to think about them? And if so, what would be the main differences between just committing to a git repo for example?

The "rolling window hashes" from the comment suggests sub-file matching at any offset. (See Bently-McIlroy diff algo/how rsync efficiently finds matches, for example.) I'm not aware that git performs this sort of deduplication. Better yet would be to use a rolling hash to decide where to cut the blocks, and then use a locality-aware hash (SimHash, etc.) to find similar blocks. Perform a topological sort to decide whi…

Git does delta compression on packfiles, and if the same data occurs in different in different files, it actually can deduplicate it, even if it's not at the same offset.

Here's a demo.

First, create two test files. The files both contain the same two 1-megabyte chunks of random bytes, but in the opposite order:

    $ openssl rand 1000000 > a
    $ openssl rand 1000000 > b
    $ cat a b > ab
    $ cat b a > ba
    $ du -sh ab ba
    2.0M        ab
    2.0M        ba
Commit them to Git and see that it requires 4 MB to store these two 2 MB files:

    $ git init
    Initialized empty Git repository in /tmp/x/.git/
    $ git add ab ba
    $ git commit -m 'add two files'
    [master (root-commit) 7f75af0] add two files
     2 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 ab
     create mode 100644 ba
    $ du -sh .git
    4.0M        .git
Run garbage collection, which creates a packfile. Note "delta 1" and note that disk usage dropped to a bit over the size of one of the files.

    $ git gc
    Enumerating objects: 4, done.
    Counting objects: 100% (4/4), done.
    Delta compression using up to 6 threads
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (4/4), done.
    Total 4 (delta 1), reused 0 (delta 0), pack-reused 0
    $ du -sh .git
    2.1M        .git
I'm not sure as if it's as sophisticated as some backup tools, though.

Re: Duplicity: Encrypted bandwidth-efficient backup

#82
post #5

Excellent piece of software, and relatively simple to use with gpg encryption. I've been using it for many years. My only complaint is that, like a lot of software written in Python, it has no regard for traditional UNIX behavior (keep quiet unless you have something meaningful to say), so I have to live with cron reporting stuff like: "/usr/lib/python2.7/dist-packages/paramiko/rsakey.py:99: DeprecationWarning: signe…

> /usr/lib/python2.7/

You are using an old version of Duplicity. It dropped all support for Python 2 in 2022: https://git.launchpad.net/duplicity/commit/setup.py?id=5505f...

Re: Duplicity: Encrypted bandwidth-efficient backup

#83
post #45
post #38

Earlier quoted context omitted.

Restic also works like this, and has the following benefits over Borg: multiple hosts can back up to the same repo, and it supports "dumb" remote file hosts that aren't running Borg like S3 or plain SFTP servers.

I really like restic, and am personally happy to use it via the command line. It's very fast and efficient! However, I do wish there was better tooling / wrappers around it. I'd love to be able to set something simple up on my partner's Macbook. For example, Pika Backup, and Vorta are popular UIs for Borg of which no equivalent exists for Restic, while Borgmatic seems to be a de-facto standard for profile configurati…

I would recommend kopia, which afaik has a similar feature set approach and a very easy to use gui. I recently used it to convert my 10 year old backups into one store. Dedup worked great.

Re: Duplicity: Encrypted bandwidth-efficient backup

#84
post #38

Earlier quoted context omitted.

Restic also works like this, and has the following benefits over Borg: multiple hosts can back up to the same repo, and it supports "dumb" remote file hosts that aren't running Borg like S3 or plain SFTP servers.

Can someone clarify if Restic dedups and compresses encrypted repos like Borg does? I feel like at some point it couldn't but maybe read that it now can? I ask because my Borg repo is an order of magnitude smaller because of dedup, so it's essential for me.

Yes, it does. You can even convert old repos (the docs mention how to do this) though you'd better set aside some time for that.

I use it weekly for system as well media backup (yt-dlp for some YouTube content as a hedge in case the channel is ever unavailable in the future).

Re: Duplicity: Encrypted bandwidth-efficient backup

#86
post #38

Earlier quoted context omitted.

Restic also works like this, and has the following benefits over Borg: multiple hosts can back up to the same repo, and it supports "dumb" remote file hosts that aren't running Borg like S3 or plain SFTP servers.

I'm a huge fan of restic as well. My only complaint is performance and memory usage. I'm looking forward to being able to use Rustic: https://rustic.cli.rs/

> The operations are robustly designed and can be safely aborted and efficiently resumed.

This is great, when you do your first restic backup on a machine it uploads all the data which takes a long time and if there is the tiniest interruption (like computer going to sleep) then you have to start from zero again, at least that's the experience I had. Instead I went via excluding the biggest directories and then removing them from the exclusion list one by one, doing backup runs in between.

Re: Duplicity: Encrypted bandwidth-efficient backup

#87

Earlier quoted context omitted.

For those of us who prefer not to ship to the cloud, have you used Kopia Repository Server and is it any good? Does it run on Windows? The documentation refers to files and directories. Does the software let you take a consistent, point-in-time snapshot of a whole drive (or even multiple volumes), e.g. using something like VSS? Or if you want that have you got to use other software (like Macrium Reflect) to produce a…

I wrote this part of the documentation: https://kopia.io/docs/advanced/actions/#windows-shadow-copy If you have problem using it, please let me know.

Neat, thanks!

Re: Duplicity: Encrypted bandwidth-efficient backup

#88
post #9

I've moved to using backup tools using content-based ids with rolling window hashes, which allows deduplicating content even between different hosts—and crucially handles moving content from one host to another efficiently—even though in other scenarios I'm guessing rdiff-algorithm can produce smaller backups. The problem I have with duplicity and backups tools of its kind is that you still need to create a full back…

For those of us who prefer not to ship to the cloud, have you used Kopia Repository Server and is it any good? Does it run on Windows? The documentation refers to files and directories. Does the software let you take a consistent, point-in-time snapshot of a whole drive (or even multiple volumes), e.g. using something like VSS? Or if you want that have you got to use other software (like Macrium Reflect) to produce a…

> For those of us who prefer not to ship to the cloud, have you used Kopia Repository Server and is it any good? Does it run on Windows?

I haven't. I use local Ceph S3 for backups, and then use kopia to mirror that to one a local RAID just in case my Ceph dies ;-).

It stores the password, base64-encoded, to ~/.config/kopia/repository.config.kopia-password. I suppose it would be nice, at least for workstations, if it supported keyrings—and it might, I haven't looked into it.

Re: Duplicity: Encrypted bandwidth-efficient backup

#89
post #11
post #8

Earlier quoted context omitted.

Your script doesn't do the same thing as duplicity. Your script mirrors the local directory with your bucket. It loses all history. Duplicity does backups (ie with history) but not just that, it does differential backups to not upload everything all the time.

S3 has bucket versioning if you want to have multiple backups. The S3 sync command also does differential backups; if you for example try to run the script over and over it will only upload new/different files.

That's not differential backups, that's optimizing the mirroring algorithm.

Differential backup here means that if a file has changed you only send the change delta, not the whole file. This is what makes it possible tobrun that kind of things every hour if needed even on large folders.

If s3 supported that and with the already existing versioning you'd have a pretty kickass solution; that's basically what you can do with rsync and a zfs filesystem for example

Re: Duplicity: Encrypted bandwidth-efficient backup

#90
post #66

Earlier quoted context omitted.

Pretty sure rclone uploads just fine without server dependencies, yeah. I never installed anything special on my home NAS and it happily accepts uploads with rclone.

It will upload fine, but it can't upload only the changed parts of the file without server support.

For the "replicating borg repos" use case this doesn't matter, because files are only written once and never modified afterwards.
Post reply on HN