News for hackers. Stuff that matters.
Re:BorgBackup, Deduplicating archiver with compression and e... by nine_k on Tuesday December 27, 2022 @03:47PM (#34153574)
If you prefer a similar approach, but as a single compiled binary, there's Restic: https://github.com/restic/restic

Update: yet another take on basically the same approach, also as a self-contained binary: https://github.com/kopia/kopia

Re:BorgBackup, Deduplicating archiver with compression and e... by mekster on Tuesday December 27, 2022 @04:28PM (#34154088)
In my book, backup tools don't count unless it has been used widely for a while without major issues repeatedly being reported.

Kopia is too new for that state.

Re:BorgBackup, Deduplicating archiver with compression and e... by Silhouette on Tuesday December 27, 2022 @05:30PM (#34154749)
That's a reasonable point but the solution - as with all things backup - is diversification. Otherwise if everyone followed your logic then no new backup software or storage service could ever become established no matter how good it actually was.

Given that all of the options being discussed here look technically better and in some cases more than an order of magnitude cheaper than other popular backup services and software discussed on HN in the past you could afford to run full redundant backups with multiple combinations of software and backing storage and still have more options for a much lower price than a few years ago.

Re:BorgBackup, Deduplicating archiver with compression and e... by eli on Tuesday December 27, 2022 @07:30PM (#34155895)
If you regularly actually test it, it should be fine. (Using a popular solution without testing it is riskier)
Re:BorgBackup, Deduplicating archiver with compression and e... by g_p on Tuesday December 27, 2022 @08:10PM (#34156240)
Kopia is pretty new, but looking through the documentation I felt it had some pretty good features that suggest it will be a good option in the future.

A few highlights (for me at least):

- They have implemented support for object locking and versioning to prevent a compromised set of S3 keys being used to erase backups. There seems to be a pull request outstanding to dynamically shift forward the compliance hold each time an object file is "deemed still used", but very few s3 bucket based backup tools seem to really think about resisting deletion and documenting best practice. I like to use minimum privilege and deny DeleteObject permission, but using versioning and object locking policies seems to be an interesting potential solution.

- Inclusion of (optional) Reed Solomon error correction codes in backup objects.

- a CLI verification option that will test a given % of your backup objects (at random) every time it's run, to give you opportunistic random verification to try find issues.

- reasonably well documented CLI options for recovering data were anything to go wrong - as the developers mention, there are a wide range of ways to recover data. Interestingly, they appear to have actually implemented these, rather than leave them as theoretical. For example, CLI commands to interact with indexes, manifests, blobs, snapshots, etc. You don't need them normally, but having these available lets you look around a simple backup and understand the format and gain confidence in it, and that the tools work.

The only feature it seems to me to be lacking is asymmetric encryption of backups, so you can keep the key needed for recovery away from the host you are backing up.

Re:BorgBackup, Deduplicating archiver with compression and e... by hashhar on Wednesday December 28, 2022 @01:22AM (#34158060)
Some more context.

> - a CLI verification option that will test a given % of your backup objects (at random) every time it's run, to give you opportunistic random verification to try find issues.

FWIW Restic also supports this - see restic check --read-data-subset (https://restic.readthedocs.io/en/stable/045_working_with_rep...)

Also Restic doesn't have any problems with buckets with deletions disallowed as long as you allow them for just the `locks` directory. A policy I used for one of my targets looked like:

    {
      "Statement": [
        {
          "Sid": "AllowAdditions",
          "Effect": "Allow",
          "Action": [
            "s3:PutObject",
            "s3:GetObject",
            "s3:ListBucket",
            "s3:GetBucketLocation"
          ],
          "Resource": "arn:aws:s3:::BUCKETNAME"
        },
        {
          "Sid": "AllowDeleteLocks",
          "Effect": "Allow",
          "Action": "s3:DeleteObject",
          "Resource": "arn:aws:s3:::BUCKETNAME/locks/*"
        }
      ]
    }
And it even works with buckets with object locking enabled since >= 0.13.
Re:BorgBackup, Deduplicating archiver with compression and e... by aborsy on Wednesday December 28, 2022 @07:36AM (#34160392)
I guess if you comment out the delete disallowing the action on lock, you can prune the repository once in a while without reindexing?

Then pruning could be done once every few months. The egress fees could be high though.

Re:BorgBackup, Deduplicating archiver with compression and e... by auxym on Tuesday December 27, 2022 @04:37PM (#34154204)
restic also seems to have better Windows support.

Borg can can run in WSL but has seen limited testing under such, per their own docs.

Re:BorgBackup, Deduplicating archiver with compression and e... by binaryanomaly on Tuesday December 27, 2022 @04:36PM (#34154184)
restic is great and simple to use. Use it for archiving my backups to Google Cloud Storage.
Re:BorgBackup, Deduplicating archiver with compression and e... by RockRobotRock on Tuesday December 27, 2022 @04:25PM (#34154052)
Does anyone have a take on Kopia vs Restic?
Re:BorgBackup, Deduplicating archiver with compression and e... by btschaegg on Tuesday December 27, 2022 @05:53PM (#34154955)
A major factor why I wouldn't want to use Kopia (I looked into it) ist that it is opinionated with regards to how your system is set up (old-school unix FS layouts in a "pets, not cattle" way). It assumes the location of config files and does not allow you to change the backup path that's stored in a snapshot's metadata.

That's bad if you want to use it

1) on NixOS (I don't want backup configs laying around in `~/.config`). As Indy famously said: "That belongs in a Nix expression!"

Edit: On a second note: Why have mandatory config files at all? I don't have an issue with having the option or it being the default, but for my use case being able to specify the whole repository config via arguments sounds considerably more sane.

2) with ZFS snapshots (yes, I'm backing up `/path/to/dataset/.zfs/snapshot/<timestamp>/foo/bar`, but that should not be its path in the metadata!)

OTOH, it seems to have the upside that you can apparently alter snapshots after the fact more easily (e.g. if you find out you shouldn't have backed up that gigantic VM image you just moved somewhere temporarily). I leave the decision on whether this is a footgun or not to you.

And to be clear: The ZFS snaphot thing is also a pain with Restic, too. You can hack around it somewhat better with something like systemd-nspawn, but it really shouldn't be that hard.

Re:BorgBackup, Deduplicating archiver with compression and e... by XorNot on Tuesday December 27, 2022 @06:27PM (#34155317)
ZFS snapshot thing was also a huge pain with bup back in the day. I remember doing some work to add in a path graft system for it but it never got merged.

Backup tool authors never seem to support this use case.

Re:BorgBackup, Deduplicating archiver with compression and e... by Freaky on Tuesday December 27, 2022 @09:17PM (#34156763)
This is why I made https://github.com/Freaky/zfsnapr

Instead of working out how to teach my backup tools about snapshots, I just mount them in a subtree and use that as a chroot env.

Re:BorgBackup, Deduplicating archiver with compression and e... by cyounkins on Tuesday December 27, 2022 @09:46PM (#34156943)
For ZFS snapshots with restic I don't use the timed snapshots and instead create a new specially named one. There's a code snippet at https://medium.com/@cyounkins/correct-backups-require-filesy...
Re:BorgBackup, Deduplicating archiver with compression and e... by proactivesvcs on Wednesday December 28, 2022 @12:00AM (#34157690)
FYI removing data from backup repositories (e.g. deleting files from a backup) is currently in the master branch of restic and will likely be in the next release.
Re:BorgBackup, Deduplicating archiver with compression and e... by attentive on Wednesday December 28, 2022 @12:13AM (#34157750)
For context, I am long time Kopia user.

Looks like compression only added in the latest release of restic.

No mounts on windows.

No GUI?

Lack of compression was likely the reason I went with Kopia.

Re:BorgBackup, Deduplicating archiver with compression and e... by kova12 on Tuesday December 27, 2022 @04:24PM (#34154037)
I recall trying to use restic instead of borg a couple years ago, and some major feature was unavailable. I don't recall what is was, I think it was compression, which made archives quite large, and required larger instances for backup.
Re:BorgBackup, Deduplicating archiver with compression and e... by m3nu on Tuesday December 27, 2022 @04:31PM (#34154143)
Restic added Zstd compression in April.

Compared to Borg it's relatively slow though. Especially when data compresses well. Maybe some potential for optimizations left:

https://github.com/borgbase/benchmarks

Re:BorgBackup, Deduplicating archiver with compression and e... by anotherevan on Tuesday December 27, 2022 @05:52PM (#34154941)
It probably was compression. The good news is compression is now available with Restic!
Re:BorgBackup, Deduplicating archiver with compression and e... by somishere on Tuesday December 27, 2022 @05:15PM (#34154580)
Big thumbs up for Kopia and its very simple GUI / strategy. Have been using it for a couple of years now to remote backup hard drives and working folders on a bunch of family macs to B2. Restored twice now - logic board & corrupt hd. Chose it after trialing both Borg and Restic for ease of use and storage cost. My monthly backblaze bill still hovers around $1.40.
Re:BorgBackup, Deduplicating archiver with compression and e... by crossroadsguy on Wednesday December 28, 2022 @02:51AM (#34158617)
1.40 for what kind of storage and transfer?
Re:BorgBackup, Deduplicating archiver with compression and e... by somishere on Wednesday December 28, 2022 @05:36PM (#34166971)
Storage is only around 250gb on B2, significantly larger on device. Egress/other averages out fairly minimal, mainly class b transactions.

https://help.backblaze.com/hc/en-us/articles/217667478-Under...

Re:BorgBackup, Deduplicating archiver with compression and e... by alwayslikethis on Tuesday December 27, 2022 @06:03PM (#34155068)
I tried Restic first due to its support of rclone. But it created many small files which is difficult to sync over my high-latency cloud service. I also saw an issue on Github about data loss, so I switched to using borg. Very satisfied with borg. Side note: they offer single compiled binaries for borg too.
Re:BorgBackup, Deduplicating archiver with compression and e... by dimatura on Tuesday December 27, 2022 @07:25PM (#34155865)
You can change the chunk size on restic, for what it's worth.
Re:BorgBackup, Deduplicating archiver with compression and e... by noAnswer on Tuesday December 27, 2022 @09:10PM (#34156698)
I tested restic a few years ago. Wanted to like it, since they directly support OpenBSD. I backuped roughly 4TB of multi media data. It took a week. After that I did a re-run. No new data, so it only took a few minutes. Than I added a tiny txt file and let it run again. It took a week again!

So I settled on borg. I use it for offsite backup. I did restores of individual files as well of whole snapshots after broken hard drives. There even was a time I used it with WSL to backup my parents data.

Re:BorgBackup, Deduplicating archiver with compression and e... by aborsy on Wednesday December 28, 2022 @01:25AM (#34158078)
These backup software are all incremental, work similarly and take similar times (difference is in details). If you lost locally cached metadata files keeping information on what has changed, they all have to scan the whole source again.
Re:BorgBackup, Deduplicating archiver with compression and e... by nine_k on Wednesday December 28, 2022 @03:47AM (#34158941)
Scanning 4TB for a week? It should not take as long even if you use magnetic tapes and change them manually.

I suppose the latency of the remote server was too high.

Re:BorgBackup, Deduplicating archiver with compression and e... by noAnswer on Wednesday December 28, 2022 @10:41AM (#34162068)
> work similarly and take similar times

Except that I tested them and they didn't. I hadn't "lost locally cached metadata". And it didn't just scan all the source files again, it re-transferred them over the network. All 4TB of it! That's why it took so long. (At that time the sever was still local, because I wanted to make the initial run not over the Internet. So there wasn't even added latency.)

I'm sure it was a bug, maybe even in combination with OpenBSD, which moste likely is fixed now. As I said it was years ago. I compared and was more happy with borg. Which stood the test of time and saved my ass multiple times.

Re:BorgBackup, Deduplicating archiver with compression and e... by bttger on Saturday December 31, 2022 @06:25AM (#34195464)
This probably wasn't a bug. I experienced the same last week but it was because I ran the backup command from a different directory. I've created a note saying:

`restic backup -v -r <location>/<repo_name> <source_dir>`

first `cd` to the parent directory of the `source_dir` to avoid too many nested directories in the repository and conflicts in the mounting point path (so that the file change detection of restic works when mounting the drive to be backed up at another point)

Re:BorgBackup, Deduplicating archiver with compression and e... by shaicoleman on Wednesday December 28, 2022 @02:49PM (#34165050)
restic has drastically improved peformance recently - increased pack size, new repository format, compression, configurable concurrency, etc.

The performance issues you experienced may have been resolved.

Re:BorgBackup, Deduplicating archiver with compression and e... by rnkn on Tuesday December 27, 2022 @07:38PM (#34155946)
* * *
Re:BorgBackup, Deduplicating archiver with compression and e... by raegis on Tuesday December 27, 2022 @08:59PM (#34156620)
Does Restic do encryption well now? When I tried it years ago you had to type the password on the command line, and there was no interest in adding GnuPG support.
Re:BorgBackup, Deduplicating archiver with compression and e... by wfriesen on Tuesday December 27, 2022 @09:35PM (#34156885)
I've been using it for a while now getting the password from a file.
Re:BorgBackup, Deduplicating archiver with compression and e... by proactivesvcs on Tuesday December 27, 2022 @11:58PM (#34157680)
You can also send the password via a password file or password command, by command line switch or environment variable.
Re:BorgBackup, Deduplicating archiver with compression and e... by wdkrnls on Tuesday December 27, 2022 @10:02PM (#34157036)
Don't underestimate the value of a self contained binary. I used to use Borg and Attic. Then I needed to recover my backup only to find that all the python dependencies had gone out of sync on Arch Linux. After that I switched to Restic. Then I had a power failure during upgrade. After that I switched to Guix.
Re:BorgBackup, Deduplicating archiver with compression and e... by ThomasWaldmann on Tuesday December 27, 2022 @10:06PM (#34157068)
You could have just used the self-contained borg binary (download from github releases page).

It contains everything needed (python, python libs, other libs) except glibc and related libs which must match the OS / kernel and therefore are intentionally not included.

Re:BorgBackup, Deduplicating archiver with compression and e... by qwertygerty on Thursday December 29, 2022 @09:52AM (#34173154)
surely,after fixing all the dependencies, and getting borg running again, you would've been able to access your backups?
Re:BorgBackup, Deduplicating archiver with compression and e... by avodonosov on Wednesday December 28, 2022 @12:23AM (#34157798)
If I remember correctly, Restic advertizes deduplication between snapshots of different machines - attractive for me, in case I have copies of large files on several machines.

Is that also true for Kopia?

Re:BorgBackup, Deduplicating archiver with compression and e... by tetha on Wednesday December 28, 2022 @02:50AM (#34158613)
Maybe I'm misunderstanding, but the deduplication of Borg happens at a repository level and after the client-side encryption. If several hosts are pushing archives containing the same files (or rather, file contents) into the same repository, they are deduplicated.

We rely on this in some places in fact. We have a couple of redundant hosts all serving the same file set. This deduplication allows us to push backups from all systems without coordination and only the first backup of the same file set requires storage beyond metadata.

Re:BorgBackup, Deduplicating archiver with compression and e... by nine_k on Wednesday December 28, 2022 @03:39AM (#34158901)
But isn't that only possible if the private keys are the same across hosts?

This may make sense, depending on your threat model.

Re:BorgBackup, Deduplicating archiver with compression and e... by tetha on Wednesday December 28, 2022 @04:26AM (#34159133)
Yes, all hosts accessing the borg repository need the encryption keys or the passphrase of the repository, since it relies on the homomorphic encryption of the repo.

And yeah, we tend to partition our borg repos along functionality and needs of restore. For example, database backups and file store backups are split into different repos, but several file store hosts in the same cluster all write to the same borg repo. After all, if something allowed to compromise one file store host, it will most likely allow compromise of all identically setup file store hosts in that cluster.

And on the other hand, in this way, we don't have to think about the backups if one of the file store hosts goes offline - the other two will just continue writing backups. This would be something that's really easy to forget and could bite very badly.

Re:BorgBackup, Deduplicating archiver with compression and e... by avodonosov on Wednesday December 28, 2022 @04:52AM (#34159294)
The article I am referencing to says:

> Another difference between the two programs is related to deduplication. Borg is designed with the assumption that each machine being backed up will use its own repository. Letting multiple machines backup to the same repository can impact performance, and simultaneous backups from different machines to the same respository are not supported.

So I should have said "Borg has limitations" instead of saying the support is absent for deduplication across machines.

When you say "without coordination", does it mean simultaneous backups from several machines to the same repo are possible?

Re:BorgBackup, Deduplicating archiver with compression and e... by tetha on Wednesday December 28, 2022 @05:42AM (#34159590)
> When you say "without coordination", does it mean simultaneous backups from several machines to the same repo are possible?

It is, with a bit of (other) coordination. Basically, only one process can actively write to a borg repository. Once something is writing to the borg repository, the repo is locked and nothing else can write to that repository.

However, you can easily stagger backups from several hosts into the same repository - node 1 writes at 09:00, node 2 writes at 10:00 and node 3 writes at 11:00. This works without problems, it just needs some monitoring for quickly growing backup sets in case your timing goes awry. You can also configure a wait timeout, how long a borg process will wait to lock the repository, but that will require some tinkering with SSH heartbeats to avoid connection timeouts, as borg won't talk over the wire while waiting.

As the documentation correctly states, this slows down the backup writing process a bit, because each node has to synchronize its local chunk cache at the start of a backup or a prune. This wouldn't be necessary if each node had their own dedicated backup repository. This can take 5ish minutes on our large repos (4TB+) and usually takes less than a minute for our smaller repos (<1TB). It's not really a big deal imo.

However - and we made that mistake earlier - something like `borg check` and other commands become really slow if you have some 15TB - 20TB+ borg repository and borg repos that large become really messy to manage. It works, but some things work at a glacial speed on a good day - while locking out all other backups. That's why we tend to group our borg repos by dataset and storage type ("All databases supporting app X backup into the app-database-X repository"). This way, all databases are in that repository even after failovers or switches to geo-standbys and it's easy to setup a restore procedure. Hoqever the overall size of the repository is somewhat limited and manageable.

Re:BorgBackup, Deduplicating archiver with compression and e... by PYTHONDJANGO on Wednesday December 28, 2022 @01:27AM (#34158085)
Note that restic has known unresolved problems with backing up to cifs shares due to some underlying go implementation details deep down in the stack:

restic fails on repo mounted via CIFS/samba on Linux using go 1.14 build https://github.com/restic/restic/issues/2659

Of course there are some cifs issues in the borg tracker, too, but most of them seem to be based on unreliable network connections - while the restic problem seems to be related to golang details.

With backups I would rather not trust a tool that has basic problems like accessing files on a network drive, but this is just me.