There are currently many tools that let you fully backup a running Raspberry into either a clone device (SD/pendrive), like rpi-clone, or to a series of rsync incremental backups (RaspiBackup by framp is a hugely versatile tool, and adds a LOT of functions over that), or to an .img file ready to be flashed (I started by using bkup_rpimage, and just now switched to a more recent version, dolorosus/raspibackup).
So, if your intent is to obtain a FULL system backup, you couldn't really wish for more, there's one tool for each taste, and yet more.
And now, for something completely different.
How can you create an essential backup, ideally of only those files that you would need to "copy over" into a freshly installed raspbian image right off https://www.raspberrypi.org/downloads/raspbian/, to get a resulting system that is "mostly surely" equivalent to the original one, functionality wise?
The objective is NOT to replace full system backups, but rather to keep a "fail safe" alternative to them, in case your backup disks are stolen, get corrupted, your wife formats them, your house takes fire, whatever; this alternative backup will be stored encrypted on the cloud (where you cannot casually store several multiple-gigabyte .img files every few days) ideally without the need to ever use it (which is the ideal concept for any kind of backup, or any means of security in general).
The requirements are: 1) There must be a reasonably easy way to restore the backup (not a big problem with a script) 2) The final restored product should practically have the same functionality of the previous system, maybe requiring only minimal manual "post-processing" 3) The size should be the smallest possible, in order to be easily encrypted and uploaded to the cloud
I am working on something like this, but I need suggestions to help create something robust, efficient, and especially more complete than what I, as a hobbyist IT enthusiast, am doing.
My own tool (https://github.com/ephestione/bazidrop) uses the following strategy:
- rsync
/homeand/etcto a local backup location, where are also saved crontabs, database(s) dumps, and a list of all the installed packages. - 7zip said backup location, and then encrypt it with GPG
- upload it to the cloud where a crude versioning system is used
Yet I feel I am missing something, for example it will not take into account programs that have been compiled rather than installed via apt, but there is surely more that can be improved.