Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

How can I create a clone with raspiBackup?

raspiBackup regularly creates any backup versions that can be restored if necessary. can be restored if necessary. Often, however, you simply want to have the last backup backup on a medium so that you can use it immediately in the event of an error, i.e. a clone. in the event of an error, i.e. a clone.

*RaspiBackup does not offer a direct option to create a clone.

However, this is possible with the help of a small auxiliary tool: With this a backup is created and this backup is then restored to a medium. to a medium. If the backup type rsync is used, the restore is only a synchronization of the changes from the last backup to the current backup and is usually done quickly.

The help tool is called raspiBackupAndClone.sh and is available on GitHub.

The following steps are necessary to use it:

Note: is the device that is to receive the clone, e.g. /dev/mmcblk0 or /dev/sda.

  1. Install `raspiBackupAndClone.sh

    1. download raspiBackupAndClone.sh
      curl -s -O https://raw.githubusercontent.com/framps/raspiBackup/refs/heads/master/helper/raspiBackupAndClone.sh
      
    2. Move the script to /usr/local/bin
      sudo mv raspiBackupAndClone.sh /usr/local/bin
      
    3. Make raspiBackupAndClone.sh executable
      sudo chmod x /usr/local/bin/raspiBackupAndClone.sh
      
  2. One-time initialization of the cloned device

    1. Create a partition-oriented backup with
      sudo raspiBackup -P -t rsync <backup directory>
      
    2. Restore the backup just created to the cloned device with
      sudo raspiBackup -d <clonedevice> <backup directory>
      
  3. Use raspiBackupAndClone.sh instead of raspiBackup.sh

    1. In the file /etc/systemd/system/raspiBackup.service
      ExecStart=/usr/local/bin/raspiBackup.sh
      
      change to
      ExecStart=/usr/local/bin/raspiBackupAndClone.sh <clonedevice>
      

If a backup is to be created manually, must be called raspiBackupAndClone.sh instead of raspiBackup.sh.

Note: If no rsync backup is possible, the line USE_RSYNC=1 must be changed to USE_RSYNC=0. Then the restore takes considerably longer, however, as no synchronization but a full restore is performed.