[Fallback] Backup and restore automatically your server

Hi all,

I’m glad to announce today the first release of a new app for YunoHost.
More than a package, it’s a also an app build only for YunoHost.

Fallback server is a 2 parts app which allow you to have a secondary server in case of failure of your main server.
Because, many of us use a home server, we have to face the eventuallity of a failure of our server or of our internet connexion. (Each summer in my case… Because my fiber do not have the right color, each technician love to unplug it…)
So in this case where you can’t do anything, you’re just alone, without your server… Naked on internet… So sad…

That’s why, from many years, I use a fallback server, simply a VPS somewhere, with some nightly backups of my server, obviously encrypted.
And, when someone unplug my life cable, I can swith on this other server and unpack my backup to bring back to my digital life.

So, now, I updated this aged scripts and made an app to give to everyone here the possibility to used this system easier.

How it works ?
I wrote a so beautiful documentation, so go read it !

Ok, some explanations…
It’s simply a backup/restore based system with a touch of checksum and a cron on one side. And on the other side, some scripts to manipulate these backups.
All your backups will be encrypted, although you can choose to disable it, and stored each night through a ssh connection in your other server.
In case of you need to switch to your other server, you’ve just to use a script to deploy all your backup and make this other server a (almost) copy of your main server. And when you’ve finished, I mean when your connection or your server is fixed, you can bring back your datas to your real main server and restore your fallback as a simple empty backup server.

But, yes there’s a but…, this application is only by CLI, and not so easy to uses, in comparaison with our usual YunoHost apps. And you have to managed your dns configuration to switch between your servers.
And, most of all, even if it’s an old app, I’m the only one to use it so far. And I made a complete rewrite of the code. So, you should consider it’s a young app. So be carefull and make a lot of backup before.

Salut tout le monde,

Aujourd’hui, je suis ravis de vous annoncer la première version d’une nouvelle application pour YunoHost.

Cette application à été développée de zéro uniquement pour YunoHost.

Fallback server est une application en 2 parties qui vous permet d’avoir un second serveur en cas d’indisponibilité de votre serveur principal.
Beaucoup d’entre nous utilisent un serveur domestique, nous devons donc faire face à l’éventualité d’une panne de notre serveur ou de notre connexion Internet. (Dans mon cas chaque été… Comme ma fibre n’a pas la bonne couleur, les techniciens aiment la débrancher…)
Du coup, on se retrouve tout seul, sans son serveur… A poil sur internet sans nos données … :frowning:
C’est pourquoi, depuis de nombreuses années, j’utilise un serveur de secours, un simple VPS avec des sauvegardes nocturnes de mon serveur, évidemment chiffré.
Et, quand quelqu’un débranche mon câble de vie, je peux me jeter sur cet autre serveur et restaurer mes sauvegardes pour retrouver ma vie numérique.

Du coup, j’ai mis à jour ces vieux scripts et créé une application pour donner à tout le monde la possibilité d’utiliser ce système plus facilement.

Comment cela fonctionne ?
J’ai écrit une très belle documentation, alors lisez-là !

Ok, quelques explications…
C’est un simple système de sauvegarde / restauration avec une touche de somme de contrôle et un cron d’un côté. Et de l’autre, des scripts pour manipuler ces sauvegardes.
Toutes vos sauvegardes seront chiffrées, même si vous pouvez choisir de désactiver ce chiffrement et stockées chaque nuit via une connexion ssh dans votre autre serveur.
Dans le cas où vous devez passer à votre autre serveur, vous devez simplement utiliser un script pour déployer toutes vos sauvegardes et faire de cet autre serveur une copie (presque exacte) de votre serveur principal. Et lorsque vous aurez terminé, je veux dire lorsque votre connexion ou votre serveur sera réparé, vous pourrez ramener vos données dans votre serveur principal réel et retransformé votre second serveur comme un simple serveur de sauvegarde.

Mais, oui, il y a un mais…, cette application est uniquement en ligne de commandes et n’est pas si facile à utiliser, en comparaison avec nos applications YunoHost habituelles. Et vous devez gérer votre configuration dns pour basculer entre vos serveurs.
Et surtout, même s’il s’agit d’une ancienne application, je suis le seul à l’utiliser jusqu’à présent. Et j’ai réécrit complètement le code. Donc, vous devriez considérer que c’est une nouvelle application. Soyez prudent et faites beaucoup de sauvegardes avant.

Merci à @gannonwoto pour la traduction en français de ce post.


:heart_eyes: I can not wait to test it and weekend is here too :smiling_imp:

Today my connection has vanished for a couple of hours during the afternoon.
So, now I can say it works !

I’ve used my fallback server and now, I gone back to my main server. Except some small errors (already fixed), all went fine.

1 Like

Hi there,

This is an awesome idea and I hope it can be developed further. I just tried to install it (via the web interface) on the main server and couldn’t make it work. Do I need to install it using Moulinette?

Thank you again!

Hi zero1Dre,

What do you mean by “couldn’t make it work” ? Do you have any error ?
Is the application installed or not ?

Hi Maniack_Crudelis,

Here’s my feedback. I finally managed to install using command line (Moulinette) as I didn’t manage to install it using the admin GUI (it asks for information like the public ssh key even if you are installing “main server”).

Once the main server was installed, I copied the public ssh key into clipboard and ssh’d to the other server, where I also installed fallback as “fallback server” (command line of course). I just pasted the key, but I’m not sure this will work.

I’m now trying to check at what time the backup will start, so I can test :slight_smile:

OK, yes I think there’s a problem with optional parameters by the admin panel.

You can try your backup manually if you want by executing the script as root.

Cool! Thank you.
I’ll let you know how that goes.

OK, I must have done something wrong because it asks me for a password (fallback@<target_server>'s password), which probably means that the ssh key exchange is not working. I’m also surprised that there’s a reference to a “fallback” user…

So I uninstalled the “fallback server” and reinstalled it (I repasted the .ssh/id_rsa.pub key for root). Still doesn’t work when I launch the script. It does the backups ok (it seems) but then it’s not able to send them.

If you have any idea of what I may be doing wrong, I’d be appreciative.

Thanks :slight_smile:

Did you used the ssh key given by the app when you installed the fallback server part ?

This part will create a specific ssh user, fallback, and a specific ssh key for this user only.
When you install the main server part, you’re supposed to use this ssh key.

Good question! I forgot to mention that during the installation, there is no key generated. At least, it doesn’t print it out on the screen…

1 Like

It should be.

Except that I inverse the parts, my bad.
It the main part that give you an ssh key. By email and also printed during the setup.

Right. So I realised the installation script creates a public ssh key in /opt/yunohost/fallback/send_process

I uninstalled/reinstalled the “fallback server” copying this new public key. I just launched the script (/opt/yunohost/fallback/send_process/send_backup.sh just to be precise).

I get a warning: ls: cannot access /etc/cron.d/yunohost*: No such file or directory

But the script continues… There are several errors of the same kind (No such file or directory) BUT it sends the incremental files! (yipee)

I’m now waiting for the script to end… OK!

That’s perfect.
But, does that mean you didn’t receive any email nor see a message with the ssh key ?

1 Like

Unfortunately neither message nor email… :confused:

Ok, I just tried it, I received an email with the ssh key.
But there was an error with the print of the key during the install. (Now it’s fixed)

At least, you should have received an email.

Maybe a config issue on my side?

Yuno emails work fine though.

But seriously, this is an ESSENTIAL app I’d say. I don’t know how others do it.
I had created a script to rsync full incremental backups to another server, but nowhere as evolved as this. I’m looking forward to test it further…

So a HUGE thank you.

I’m glad that you like it.

This app is not (yet) widely used, so don’t hesitate to say if you encounter any issue with it.

1 Like

Hello @Maniack_Crudelis ,

I tried to install the app but the process failed with this message :

+ ynh_print_OFF
+ set +x
Attention : _common.sh: ligne 564: mail : commande introuvable
Attention : !!
Attention :   fallback's script has encountered an error. Its execution was cancelled.
Attention : !!
Attention : 

If you need additional information, I’m also available in the chatroom https://riot.im/app/#/room/#yunohost:matrix.org