billw2 / rpi-clone

A shell script to clone a booted disk.
BSD 3-Clause "New" or "Revised" License
2.49k stars 327 forks source link

Command line option to only clone to specific drive type #109

Open davet2001 opened 3 years ago

davet2001 commented 3 years ago

I run rpi-clone to backup my OS drive. When my SD card starts showing errors, I swap out the failing SD and order a new one. Works great! Thanks for a fantastic tool!

But I also have a 1TB spinning disc attached to my RPi that I use as a file server.

The trouble with scripting rpi-clone is being very sure that it's backing up to the right place. If something causes sda and sdb to swap over, it might not be. Each time the confirmation screen pops up, I panic wondering whether I'm about to lose important data.

I made a script to help me. It checks the drive type before proceeding with rpi-clone. https://github.com/davet2001/miscellaneous/blob/master/rpi-clone.sh

Could this sort of functionality be built in to rpi-clone?