Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

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

  1. Install raspiBackupAndClone.sh
    1. Download of raspiBackupAndClone.sh curl -s -O https://raw.githubusercontent.com/framps/raspiBackup/refs/heads/master/helper/raspiBackupAndClone.sh
    2. Move the script into /usr/local/bin - sudo mv raspiBackupAndClone.sh /usr/local/bin
    3. Make script executable sudo chmod +x /usr/local/bin/raspiBackupAndClone.sh
  2. Initialize the clone device once
    1. Create a partition oriented backup with sudo raspiBackup -P -t rsync <backupDirectory>
    2. Restore this backup on the cloneDevice with sudo raspiBackup -d <cloneDevice> <backupDirectory>
  3. Call raspiBackupAndClone instead of raspiBackup in the systemd timer
    1. In /etc/systemd/system/raspiBackup.service change ExecStart=/usr/local/bin/raspiBackup.sh in ExecStart=/usr/local/bin/raspiBackupAndClone.sh <cloneDevice>.
  4. 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.