Skip to content

Instantly share code, notes, and snippets.

@koma-xrd
Created July 7, 2021 12:37
Show Gist options
  • Save koma-xrd/5c9b4a83cbe0681bf8736ab52267cc94 to your computer and use it in GitHub Desktop.
Save koma-xrd/5c9b4a83cbe0681bf8736ab52267cc94 to your computer and use it in GitHub Desktop.
#07072021: backups of the booted ssd to the non booted ssd
booteddisk=$(df /boot | grep -Eo '/dev/[a-z]*')
if [[ "$booteddisk"=="/dev/sdb" ]]
then
echo "booted from sdb - cloning to sda"
sudo rpi-clone sda -f -U
else
if [[ "$booteddisk"=="/dev/sda" ]]
then
echo "booted from sda - cloning to sdb"
sudo rpi-clone sdb -f -U
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment