I wrote some scripts to run regular backups of nextcloud on ncp

In case someone is interested: After I had a corrupt SD card and needed to re-install ncp, I wrote some scripts to automate backups of my ncp, DB, and data.

The scripts use:

  • the wonderful kopia for backup (using hashes and splitting to save only changed parts of large files), compressed, fast!)
  • optional: use zstd to compress DB dumps
  • and save backup to Storj cloud storage (but you could connect to another kopia repository if you want, of course. However, Storj currently offers 150 GB for free and is much cheaper than all other providers I found. And I like the idea of the distributed approach with open source software and anyone can sign up to host a Storj node. I didn’t understand the details of erasure codes as redundancy approach :thinking:, but it sounds to me like someone really thought in depth about this… :face_with_peeking_eye:)

In fact, the scripts are quite simple: just two systemd services for a “full” (including mainenance mode to be sure everything is in sync) and normal backup that are run by systemd timers.

3 Likes

Interesting, thanks for sharing. NCP has a nice set of backup and restore tools built in.
I have never needed more for my personal use.

NCP has a nice set of backup and restore tools built in.
I have never needed more for my personal use.

Yes, I know. My NCP runs on a raspberry PI with two USB HDD attached and in the beginning I experienced that the Pi does not provide enough power to drive both HDDs. And btrfs really does not like HDDs with not enough electrical power, so I had also my backup disk corrupted 1 or 2 times before I figued out what was the problem and bought an addition USB switch with extra power supply… and in any case I feel better to have an additional backup somewhere in the cloud.