NAS failsafe and disaster recovery options

A subforum dedicated to topics around the NAS.
PatrickW
Posts: 146
Joined: 25/11/2019, 13:34

Re: NAS failsafe and disaster recovery options

Post by PatrickW »

TerryJC wrote: 06/04/2020, 17:41 The problem with building it yourself is that the physical construction becomes a bigger problem than the hardware, eg case, slots, cooling etc, but it's all possible.
It depends on the requirements. To satisfy the requirement for an off-site backup when I was at university, I bought the standard aluminium case for my SBC, added some rubber feet and stacked it on top of a similarly designed of USB HDD enclosure like they were Hi-Fi components. Job done. Worked a treat and looked pretty neat if you ignored the mess of wires. :P

But you're not wrong. It would have been a different story if I wanted it all in one enclosure, or SATA instead of USB.
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: NAS failsafe and disaster recovery options

Post by TerryJC »

PatrickW wrote: 06/04/2020, 21:14It depends on the requirements. To satisfy the requirement for an off-site backup when I was at university, I bought the standard aluminium case for my SBC, added some rubber feet and stacked it on top of a similarly designed of USB HDD enclosure like they were Hi-Fi components. Job done. Worked a treat and looked pretty neat if you ignored the mess of wires. :P

But you're not wrong. It would have been a different story if I wanted it all in one enclosure, or SATA instead of USB.
All agreed. The main reason that we went with the NAS Box in the first place was that I had one that I wasn't using and it seemed like a good idea at the time - plus it came fully packaged. Perhaps not such a good idea in hindsight. :( (Although it has given Hamish hours of innocent fun and amusement. :D )

Had it not been available, we might have considered a NAS Box type solution for backups and we might have done something completely different. Since the NAS box was available and we liked the idea of using a database for storing and retrieving the results during normal operation, then that was proposed as the primary storage and we are now looking at alternatives for backup. In other words the problem has now changed back to backup solutions but for the NAS Box and not the files on the SD Card!

Whatever we had chosen we would probably have ended up constructing some kind of packaging solution, probably based around an IP65 Box as with many of the other installations around the site.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: NAS failsafe and disaster recovery options

Post by hamishmb »

I think it's always good to reuse what you have when you can. I'm glad I went and got it before all this happened - it allows me to experiment, whereas before I wouldn't have been able to.

It's a bit difficult to find the time/motivation at the moment, but I fully intend to have this working sooner or later, and hopefully when the model town re-opens we'll have something ready to deploy.
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: NAS failsafe and disaster recovery options

Post by hamishmb »

Note: This is still something that is yet to be done.

I imagine this is best done with a simple spare USB stick for the moment. Is automatically backing up the database something we're still interested in doing in the short-to-medium term?
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: NAS failsafe and disaster recovery options

Post by TerryJC »

I think that would be a good idea. Probably not a super high priority but something worth doing.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: NAS failsafe and disaster recovery options

Post by hamishmb »

I have now created us some backup scripts at https://gitlab.com/wmtprojectsteam/nas- ... re-scripts

I have tested these and they work, but I have not yet gotten them to work with cron. I believe the problem is something to do with the environment variables that aren't set in cron's environment. I'll keep working on this and get it done.

Currently we can take manual backups by running:

Code: Select all

cd /mnt/HD/HD_a2/backupandrestore
python3 ./backup.py
And restore with:

Code: Select all

cd /mnt/HD/HD_a2/backupandrestore
python3 ./restore.py <path/to/file>
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: NAS failsafe and disaster recovery options

Post by TerryJC »

Excellent progress.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: NAS failsafe and disaster recovery options

Post by hamishmb »

Think I've got it working automatically now, though it's not visible in crontab because it's in root's crontab, and there's no way to switch to root (su and login don't work).

If it works we should have a new backup on Monday morning (backs up weekly a 1AM on Monday morning).
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: NAS failsafe and disaster recovery options

Post by TerryJC »

How do you know it's in root's crontab if you can't login as root?

Puzzled of Corfe Mullen
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: NAS failsafe and disaster recovery options

Post by hamishmb »

Ah, because the startup scripts run as root (I confirmed this before), but we log in as "admin" who is almost root in terms of privileges. They run as root because they're initiated from the end of the rest of the NAS box's startup scripts.
Last edited by hamishmb on 22/09/2020, 13:06, edited 1 time in total.
Hamish
Post Reply