Automating backup of SD Card

Just wanted to share a finding I should have found years ago. Since long I have a personal habit of making a copy of my SD Cards in all my RPi's from time to time. In all of them I have an additional SD Card reader with an extra SD Card of similar size as the active one

Using the included Raspbian tool, the "SD Card Copier", has been working fine but the disadvantage is, it requires access to the desktop and it cannot run unattended. Besides, you have to wait for it to finish, so it requires your attention to a certain degree

I try & like to make boring things automated. Set & forget is my target for recurring tasks. So when I found the rpi-clone, I thought, maybe here is a possibility: GitHub - billw2/rpi-clone: A shell script to clone a booted disk.

My initial tests with this tool are very succesful. Interestingly, it seems it is also able to (by default) make incremental backups. My second run, on the same SD Card, just took some five minutes! You run it from a cmd prompt, fully unattended if you want, without any need of user interaction. The tool has many well documented parameters you can use

I tried the resulting SD Card copy in one of my RPi's and it worked as I hoped for. Booted up, everything was there, the same as the original

Next up was to setup some scheduled unattended automation. No doubt, I thought let's use Node-RED to make this happen. In all RPi's I added a simple flow that would run the tool when triggered via MQTT. If it would fail for some reason, I will get notified via Telegram. If successful, just a positive log entry will be added in a simple text file

In one of the computers I also added the triggering part, initiating the backup in all my RPi's once per month. After my next test with all running and finishing successfully, I could not hesitate, I added my Jetson Orin Nano to the group EDIT: but that device was not supported

Did you see the comment in this issue? Unable to boot into original SD card after cloning from SD card to SSD · Issue #185 · billw2/rpi-clone · GitHub

Apparently that repo is not maintained, and there is a fork here -

@Colin & @Sean-McG , thank you very much! I did not see that, so thanks a lot! To my understanding issues with the old repo are mainly related to

  • cloning an SD Card to a SSD or NVMe drive
  • cloning an SD Card w Bookworm

I only tried SD Card to SD Card and those I tested worked ok, But for sure, using maintained repos is a must so thank you!

While digging around there in the reported issues, another interesting tool was mentioned (not tried it, no plans either so far): GitHub - framps/raspiBackup: Create and keep multiple backup versions of your running Raspberries

1 Like