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: /dev/mmcblk0
or /dev/sda
.
-
Install `raspiBackupAndClone.sh
- download
raspiBackupAndClone.sh
curl -s -O https://raw.githubusercontent.com/framps/raspiBackup/refs/heads/master/helper/raspiBackupAndClone.sh
- Move the script to
/usr/local/bin
sudo mv raspiBackupAndClone.sh /usr/local/bin
- Make
raspiBackupAndClone.sh
executablesudo chmod x /usr/local/bin/raspiBackupAndClone.sh
- download
-
One-time initialization of the cloned device
- Create a partition-oriented backup with
sudo raspiBackup -P -t rsync <backup directory>
- Restore the backup just created to the cloned device with
sudo raspiBackup -d <clonedevice> <backup directory>
- Create a partition-oriented backup with
-
Use
raspiBackupAndClone.sh
instead ofraspiBackup.sh
- In the file
/etc/systemd/system/raspiBackup.service
change toExecStart=/usr/local/bin/raspiBackup.sh
ExecStart=/usr/local/bin/raspiBackupAndClone.sh <clonedevice>
- In the file
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.