andrey-malets / cfg

Configuration infrastructure for RUNC network and hosts
3 stars 3 forks source link

Write restore script #26

Open andrey-malets opened 9 years ago

andrey-malets commented 9 years ago

Algorithm should be something like this:

  1. Bootstrap base system with debootstrap. Files from /etc/apt/souces.list may be useful while getting system bootstrapped.
  2. Restore essential system files: /etc/passwd, /etc/shadow and so on. This is required to properly restore all the user names and UIDs which may get created randomly during package installation and therefore may not work with files from backup.
  3. apt-get install --no-install-recommends all the packages from backup. This step may require additional check for package availability (not all packages may have been installed from known sources, we need to skip those).
  4. Restore all system and user files from backup. If the backup has some databases files, restore them also. This should be done iteratively by taking full backup as a base and applying diff backups one after another. tar --numeric-owner option must be used.
  5. Install kernel image and configure bootloader, if required.