AIO Borg Backup + Crashplan

Hi All,
Iā€™m hoping someone here might be able to give me a little advice regarding BorgBackup on Nextcloud AIO?
I recently moved from my very old nextcloud install to a new box that I decided to set up with AIO to make it easier to maintain.
This is my first containerised install and I havenā€™t played with AIO before.
Unfortunately, I didnā€™t look into the packaged backup system (BorgBackup) to closely and assumed that it just backed up the configuration and database.
After a bit more reading, Iā€™ve realised it backs up all the user files as well, dumping a packed/deduped copy of them onto the local storage.
Iā€™m already backing up the user file areas using Crashplan so it all gets sent to their cloud storage.

So, to my questionā€¦
Can Borg be configured to backup everything except the user files? Thereā€™s quite a lot of them and I donā€™t want a second copy stored on the local drive.

Thanks in advance for any suggestions and advice you can offer! All gratefully received!

welcome in the forum!

in general BorgBackup is highly customizable but the AIO version might be notā€¦ You miss the idea of AIO if you try to fiddle with the system. AIO is designed to be highly standardized system with little to no configuration. I would sort your request into the category of advanced user who is not the audience of AIO.

I would suggest to adopt your backup strategy and use built-in AIO backups or donā€™t use AIO and built your own customized systemā€¦

@szaimen - do I miss something?

There is actually a way to exclude certain directories but I would not recommend to do this because restoring will not work as expected.

Also having a backup at two locations is a good thing in general?

Hi wwe & szaimen,
Thanks for the advice. I was toying with the idea of setting up the user file storage as an external storage on the local machine as I believe that Borg then leaves it alone. Either that or modifying the Borg backup set so it ignored the ā€˜filesā€™ folders for each user.
However, you are probably right - keep it as standard as possible. Iā€™ll have to bite the bullet and install another hdd and mount that for borg to dump the backups to.
As szaimen suggested 2 backups are better than one!
Thanks again.

1 Like

Hi, I have the same need to exclude the data directory.
I recently started using AIO because it is much easier to maintain than setting all up manually. But I have for my user data directory a self configured backup solution that work since years and I need a way to exclude that from the borg backup.
I know that a restore would be complicated. But I already have two places where the data are backed up to. So I only need the container configuration backup.

@szaimen you mentioned their is a way to do that. It would be much appreciate if you could elaborate on how to do that.

This would help me a lot.

Thank you.

If you really donā€™t want to switch to the included backup solution, I would for your case probably recommend that you use this to stop and start AIO correctly before/after running the backup and then simply including all docker volumes which are usually stored in /var/lib/docker/volumes on the host. Then you can also exclude directories/volumes that you donā€™t want to back up. You can even disable the backup section in that case by following this.

@szaimen
I read this but didnā€™t realized this could solve my problem and can continue to use my own backup solution that I have since I stared using owncloud years ago. And used when I moved to nextcloud.

Thank you.

Iā€™ve recently migrated to an AIO install after having run a ā€œnormalā€ NC install for a couple years. Iā€™m actually OK with using the borg backup, but I want to be sure that I understand what it is doing.

On my old install I was using Bacula as my backup solution. The cloud backup job would start by placing the NC instance into maintenance mode, dumping the database info into some files in the NC install, then taking NC out of maintenance mode and backing up the NC install and the user data files to an external drive.

Does the borg backup do something similar? I have the AIO backup configured to create itā€™s backup on my external drive, but is the NC database dumped and included in that backup?

Thanks
/dwight

The basic concept of the built-in daily backup feature is indeed stopping all containers including a database dump, creating the backup and starting the containers again after the backup is done.

Ok. I think it would be better if the containers could be brought back up after the database dump was finished so that the instance would be available sooner, but I can also understand how that might not work as easily with docker containers. I can live with it as is.

One more question - is it possible to trigger a custom script after the backup has completed? That way I can clone the backup files to an off-site storage for redundancy.
/dwight

No but you can simply sync the backup archive regularly to a remote location using a script and crontab entry. Here is an example for syncing to a second drive: GitHub - nextcloud/all-in-one: The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.

Yeah, I figured I would end up using a cron job. Bacula has the ability to kick off custom commands before/after a job, so I had it kick of the cloning after the backup was completed. The problem with a cron job is that if the backup job runs too long for some reason, the clone could potentially start before the backup is complete and leave you with a corrupted file in the offsite.

Thatā€™s probably an extremely low probability scenario though and Iā€™m just overthinking it. The cronjob will be fine.

Thanks
/dwight

Just have a look at the pointer and script that Iā€™ve sent. There are actually some ways to check if a borg backup is still running. (Search for lock.roster). Also a feature is implemented to not start the next AIO backup if you are running a script externally. (Search for aio-lockfile).

Just found that. I should have expected that NC would create a lockfile to protect the backup. Iā€™ve modified the script for my specific needs and Iā€™ll kick it off now. In a couple hours Iā€™ll know if I need any other changes.

Thanks
/dwight

1 Like