Remember to make a backup!

26 years I work in IT. 26 years…

last sunday decided to update my openhab pi to the latest version of openhab. I did not check my backup cause well, it’s a cron job, it just runs.

So my Pi did not come back after the reboot, I found it in kernel panic. Never mind, I have a backup, just let me get it and do a rebuild… The last time my cron job worked was in januari this year…

At least I get to do my cleanup now… quite effective! :slight_smile:

12 Likes

I can’t think of a suitable reply, that doesn’t start with… “Whoops…”

How about “Trust, but verify”. :wink:
Disaster recovery has been a part of recommended IT policy for a long time. Unfortunately, very few (including me) practice it,

2 Likes

Thanks for admitting in public.

All to read this, spend some of your minutes on reading the Amanda documentation of openHABian (the first paragraphs at least).

no-backup

1 Like

Just checked my backups. Everything works fine.
I do an openhabian backup every 4 days, save it locally and to another computer in the network and the whole config is in a private github project. :innocent:

1 Like

image

1 Like

I really recommend you check in your config and code in versioning system such as git or subversion. You then get history of changes and you can go back if needed. You still need to back up your versioning system, unless you make a private repo at github or similar.

I check in all my config on all servers, rpi etc. It has saved me numerous times.

3 Likes

It’s a little annoying, but that’s why I have my backup cron jobs email me a little confirmation when they run. Then I might notice. “Hey, I didn’t get that PosgreSQL was backed up email this morning, better look into that.” But now I realize I need to probably add some more confirmation like listing the size and contents of the tarball to the email. It might be saving zero length backups and I’d never know it.

Another thing I do is code all my configurations in Ansible so as long as I have the data/configs backed up I can rebuild the machine with a quick run of a task. I had to do this just this last week as my NUT server lost power (ironic I know) and corrupted the file system. Rather than fight it I burned a fresh Raspbian image and ran my Ansible task and was right back up and running. It was the first time I was able to prove out this approach personally and I’m very pleased.

I’ll also add to the chorus of those recommending checking in the configs to git or some other source control system. Even if you do everything through PaperUI, the JSONDB is a text file and perfectly suitable to source control. All my OH configs, Ansible scripts, etc are checked into a private Gogs server.

2 Likes

I have been using Ansible for my general purpose RPI’s including my Kubernetes cluster, but I’ve held back on experimenting with my OH installation. I would really appreciate it if you would share both your config files and your general experience with using Ansible with OH.

Thanks,
Bjarne

It was just a dumb mistake. Just lazy. Sometimes you got to admit it publicly to save others the embarrassment.

For now a cron job is dumping my opehab config on my NAS and it works, yes I checked!! :slight_smile:

@rlkoshak I saw you mentioning ansible in a different post a while ago. I have to take a good look at that. For now I will do a fast rebuild since I don’t have time but I will keep that in mind for the future.

2 Likes

FWIW, Amanda backup runs are started from cron (or systemd timers, actually), and you actually get the result mailed to you, too.
Just sayin’ because an OH user to read this thread might not be capable of setting up his own backup system like we IT guys can. That’s why Amanda is there, part of openHABian.

PS: admittedly, I don’t validate every single report either.

I don’t want to hijack this thread so I’ll post a new one. For some of my older examples and musings see A quick intro to Ansible. There has been a lot written on the forum in addition by me and others. I’ve recently gone through a complete rewrite of my roles to make them all much more idempotent. I’m not yet using Ansible vault so I can’t really post the whole shebang to Github but I can share the openHAB related ones here.

I’ll update this reply once I write the new post about Ansible.

But a tl;dr is my general experience using it with OH is the same as using it for NextCloud, my own custom services, Nightscout, etc. It’s awesome! I don’t have to remember anything! It’s all written down and it’s all there checked in to my personal git server where I can see the history of my machine’s configurations. OS upgrades are super easy too: install the new OS and run the Ansible playbook to reconfigure everything. Everything is documented and repeatable.

1 Like

On the 7th day, God made a backup…

1 Like

IIRC he rested that day. So seems he had automated that ?

1 Like

Git is very helpful for OH configs.
History might be helpful especially if you put meaningful comments.

Git (I use Azure DevOps) is a godsend for all types of (text based) configurations and code. Personally, I use it for:

  • Dev projects
  • Ansible “configurations”
  • Kubernetes projects
  • and configurations for OpenHAB

The thing is, Git doesn’t help you when you have to apply a full setup to a new server. Only a backup or a set of Ansible roles and playbooks will do that trick.