Make zzz_evobackup more automation friendly #40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The current script requires too much boilerplate when updating. I'd prefer having a clean file level separation between variables.
zzz_evobackup.cfg
This first file would contain all the top level variables necessary for the next two scripts. It could also contain the include / exclude list for rsync.
zzz_evobackup_operations.sh
This would be empty by default, but would contain any operations necessary to dump application information. This would be used for full backups.
zzz_evobackup.sh
This would be the main script in cron, it would do all initialization and finalization tasks (such as creating directories, syncing and logging) and include the two former scripts. It would also take care of dumping the information necessary for a system only backup.
This separation would mean that you generally only need to change zzz_evobackup.sh when updating. In rarer cases, you would also have to change the variable names in zzz_evobackup.cfg.
I'm not sure I should be spending time on this or if I should spend it on the bkctl client command instead, so I'm laying down my plans here to receive feedback.
This is the tool I referenced at the end: https://gitea.evolix.org/evolix/bkctl
I wholeheartedly agree that the current evobackup script is a nightmare to upgrade.
The fact that it's a single script has a major benefit : it's simple to read, understand, copy, customize…
… but I think a more modular approach has much more potential.
I think we should have tasks (scripts, config, whatever) :
We should be able to enable/disable tasks, add custom tasks, execute them in any order we like.
We should be able to dump data sources once even if we have many remote sync tasks
We should be able to sync to different groups of servers, each with its own strategy (roundrobin, fallback…)
We shold have core tasks that can easily/safely be updated with Ansible, and custom tasks that are separate.
That said, I still don't have a clear picture in mind about the concrete architecture of this.
If we accept to go for a big change in how we backup servers, we could also have a look at other existing software.
For example, I've been using BackupNinja for years (until a couple of years ago) on a personal server. It has all we want and more. It even is available as a Debian package. It has the same basic philosophy as ours.
BackupNinja looks interesting. Except the last release (and commit) was over a year ago. Is that because it's simple and mostly done or because it's not maintained enough ?
As for zzz_evobackup, I think the most modular approach would be to a configuration file and a remote syncing script that would dynamically execute all the scripts in a given folder, we could then have one file for each dump generation task.
The disadvantage is thats a lot of files. The advantage is that it would be manageable with ansible templates and a little clearer what tasks are activated.
I havent looked into the advantages of bkctl yet.
This piece of software has been maintained for over 9-10 years and has an actively maintained package in Debian. I would worry too much abouth the commit frequency.
As you say, it's been pretty stable and doesn't need a lot of work on a day-to-day basis.
Great ! The main standing issue for me is whether it supports OpenBSD. I'm not seeing a package in the ports tree. But it seems to be bash code, so it should be possible to port.
Would you be willing to setup an internal linux server with BackupNinja so we have a working example ?
Ideally, it would be accompanied by a new entry in https://wiki.evolix.org/
I've thought about that and I think it's feasible.
I'll start with my own personal server and if it's good enough I'll use an internal server.
In the meantime, I will take a closer look at bkctl.