I would like to backup a Debian 9 server system drive, SAFELY, using cron (thus non-GUI solution is wanted) to a remote ISCSI drive through local network. Using EXT4 as system partition format.
By "SAFELY", I mean: the backup should be atomic, race condition free. Also it's a requirement, that the system restore should be relatively easy and fast from the remote ISCSI. Backups of data drives are done to remote ISCSI drive on local network.
Currently I use two kind of solutions, to be able to recover when system partition is lost, and have to recover from scratch:
- Keep changes history of /etc directory using etckeeper (uses GIT internally)
- Keep a copy of system partition files with rsnapshot (uses RSYNC internally)
However I think this system backup is not safe enough, as it is not atomic backup (while backup is done, there can be changes happen on the system drive).
Other solutions I might consider are:
- Using LVM as system drive format, because LVM snapshots are atomic. Thus I can make snapshots before Debian upgrades or if I create backup of an LVM snapshot to remote ISCSI local network drive, I could restore it in case of system drive data loss.
- Using Systemback (available as package in Ubuntu) - Systemback makes it easy to create backups of system and users configuration files. In case of problems you can easily restore the previous state of the system. There are extra features like system copying, system installation and Live system creation. Systemback seems to be safe as it creates system restore point, like a snapshot.
- Using dd command through SSH to remote ISCSI local network drive. However this solution is not SAFE, is not atomic.
- Using a Configuration Management tool (like Blueprint, CFEngine, Chef, Puppet, Ansible) to keep track of changes of the Debian system. Keep one complete bit to bit copy of a clean working Debian 8.7 system remotely, then restore only the changes tracked by Configuration Management tool.
- Do you have there any bad experience with one of these solutions?
- Do you have any good experience with one of these solutions?
- Which solution would you suggest?
I suppose the Configuration management tool would be useful, because it would make possible to make a byte to byte backup of an original distribution, then store all custom configuration changes using configuration management software.
I would like to shorten the restore time after a system crash & minimize the chance I lose any system configuration change compared to periodical (daily) backup. I suppose restoring system backup with dd, then using configuration management to restore the configuration settings of the Debian would be the quickest solution.
Is that right?