raspiBackup creates on a regular base backups and keeps a configurable number of backups which can be restored if needed. A lot of folks want to have the latest backup restored already on a second device which can be bootet immediately if the system fails for some reasons to reduce the downtime of the system. raspiBackup doesn't support to create a clone. But it's possible with a small helper tool which executes a restore just after the backup. If rsync as the backup type is used the restore is actually no restore but a synchronization of the changes between the last restored backup and latest backup which is in general very fast.
Attention
There exists now a complete new raspiBackup documentation that replaces all raspiBackup documention on this website.
The helper script is called raspiBackupAndClone.sh and is available on github.
Note: <cloneDevice> is the device which will get the restored backup, e.g. /dev/mmcblk0 or /dev/sda
- Install raspiBackupAndClone.sh
- Download of raspiBackupAndClone.sh
curl -s -O https://raw.githubusercontent.com/framps/raspiBackup/refs/heads/master/helper/raspiBackupAndClone.sh - Move the script into /usr/local/bin -
sudo mv raspiBackupAndClone.sh /usr/local/bin - Make script executable
sudo chmod +x /usr/local/bin/raspiBackupAndClone.sh
- Download of raspiBackupAndClone.sh
- Initialize the clone device once
- Create a partition oriented backup with
sudo raspiBackup -P -t rsync <backupDirectory> - Restore this backup on the cloneDevice with
sudo raspiBackup -d <cloneDevice> <backupDirectory>
- Create a partition oriented backup with
- Call raspiBackupAndClone instead of raspiBackup in the systemd timer
- In /etc/systemd/system/raspiBackup.service change
ExecStart=/usr/local/bin/raspiBackup.shinExecStart=/usr/local/bin/raspiBackupAndClone.sh <cloneDevice>.
- In /etc/systemd/system/raspiBackup.service change
- If a backup should be created manually now call raspiBackupAndClone.sh instead of raspiBackup.sh all the time
NOTE: If no rsync can be used change in raspiBackupAndClone.sh line USE_RSYNC=1 in USE_RSYNC=0. But then the restore takes much more time because the restore is no synchronization but a full restore.

