How can I set this up so that it itself checks if there is an sd or usb, so it makes a backup depending on whether I have an sd card or usb disk attached?
dd if=/dev/mmcblk0 of=${BACKUP_PATH}/${HOSTNAME}${ARCHITECTURE}bits-${BACKUP_DATO}.img bs=1MB status=progress
echo "Backup Image from SD-Kort"
dd if=/dev/sda of=${BACKUP_PATH}/${HOSTNAME}${ARCHITECTURE}bits-${BACKUP_DATO}.img bs=1MB status=progress
echo "Backup Image from USB"
man bash
and test to see if the file exists. – joan Jun 01 '22 at 14:46dd
with all of its flaws as a backup solution? Tryimage-backup
instead - the "how to" is in another answer here on SE – Seamus Jun 01 '22 at 21:08