Backup Nextcloud Files to Freenas-Pool

MathisR

Cadet
Joined
Dec 28, 2019
Messages
2
Hey!

I just successfully without major hiccups (can't believe my luck yet) set up a FreeNAS (11.2) server for my Dad. The thought behind it is that it has one mirrored large archive pool (2x4Tb) where he can dump all of his data in one place and one 1Tb (1x1Tb) pool, that is available to a nextcloud installation, that he can also access from outside of the home network. Everything is working fine so far.
Now I was wondering if there is a way to backup the nextcloud pool on the 1Tb HDD to the large redundant archive maybe once a week. I looked at the tasks in FreeNAS but couldn't find an option that sounded suitable. Could someone hint me in the right direction to achieve this? It would be hugely appreciated.
Thanks for your efforts!

Best,
Mathis
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
There are several ways. I have a script that rsync my pools to another server, including the one dedicated to NC. You can do that from one pool to the other.

Create a script and cron job to run it every X interval. I do mine every hour.
 

blueether

Patron
Joined
Aug 6, 2018
Messages
259
I use snapshots and zfs send <CloudFiles@snapshot> | zfs recv <BackupVault> to back up my nextcloud files and DB
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
I have a script in FreeNAS that 1. Puts Nextcloud in maintenance mode 2. Takes snapshots of the jail itself and the dataset I have for data 3. Dumps the database 4. Turners off maintenance mode (for minimum user interruption) 5. Creates tar archives of data and web app from snapshots and database dump. Finally I take a snapshot of the archive dataset to make sure it’s reasonable safe and copies the content to an offsite location.

the downtime is measured in seconds for a small database and the resulting tar archive contains everything needed to recreate the app once a jail is rebuilt. I’m planning to add jail creation to the script similarly to @danb35 ‘s script but life happens :)
 
Last edited:

micxer

Cadet
Joined
May 29, 2013
Messages
1
@garm that's exactly what I want to have for my Nextcloud jail. Have you shared your script somewhere? Would be nice to have it as a starting point...
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
the downtime is measured in seconds for a small database
You could actually put step 4 before step 3 and that number would be measured in milliseconds. But it would add extra steps and I get why you haven't done it that way.
 
Top