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/mmcblk0or/dev/sda.
-
Install and configure raspiBackup
-
Install
raspiBackupAndClone.sh- download
raspiBackupAndClone.shcurl -s -O https://raw.githubusercontent.com/framps/raspiBackup/refs/heads/master/helper/raspiBackupAndClone.sh - Move the script to
/usr/local/binsudo mv raspiBackupAndClone.sh /usr/local/bin - Make
raspiBackupAndClone.shexecutablesudo chmod x /usr/local/bin/raspiBackupAndClone.sh
- download
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.
-
One-time initialization of the cloned device
- Create a rsync backup with
sudo raspiBackup - Restore the backup just created to the cloned device with
sudo raspiBackup -d <clonedevice> <backup directory>
- Create a rsync backup with
-
Run raspiBackupAndClone once manually
sudo raspiBackupAndClone.sh <clonedevice>and carefully test the clone
-
Use
raspiBackupAndClone.shinstead ofraspiBackup.sh- In the file
/etc/systemd/system/raspiBackup.service
change toExecStart=/usr/local/bin/raspiBackup.shExecStart=/usr/local/bin/raspiBackupAndClone.sh <clonedevice>sudo nano /etc/systemd/system/raspiBackup.service
- In the file