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 finishes much earlier. For all other backup types and backup modes, the restore is always a standard restore and not a synchronization.

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

The following steps are necessary to use it:

Note

<clonedevice> is the device that is to receive the clone, e.g. /dev/mmcblk0 or /dev/sda.

  1. Install and configure raspiBackup

  2. 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
      

Important

Don’t forget to execute the following steps to initialize the <clonedevice> [!WARNING] Make sure that the specified <clonedevice> is the correct device. Otherwise, you risk losing data.

  1. One-time initialization of the cloned device

    1. Create a rsync backup with
      sudo raspiBackup
      
    2. Restore the backup just created to the cloned device with
      sudo raspiBackup -d <clonedevice> <backup directory>
      
  2. Run raspiBackupAndClone once manually

    sudo raspiBackupAndClone.sh <clonedevice>
    

    and carefully test the clone

  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>
      
      sudo nano /etc/systemd/system/raspiBackup.service