MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

Backing Up Magic Mirror

  • I was wondering how to backup my SD card. I already have Win32DiskImager installed on my computer, but I wanted to know how exactly to set up a backup in case something happens to my raspberry pi.

  • You just put your SD card in and instead of writing to the card you do a read… name your image file and store it somewhere safe in case you need it 🙂

  • I still do not understand. I don’t know the name of my img file.

  • Oh. I understand now.

  • @AAPS

    sudo nano /home/pi/
    DIENSTE_START_STOP="service mysql"
    # Stopp any services before backup
    # Create backup with dd in your desired path
    dd if=/dev/mmcblk0 of=${BACKUP_PFAD}/${BACKUP_NAME}-$(date +%Y%m%d-%H%M%S).img bs=1MB
    # Star services after backup
    # Delete old backup after X backups
    pushd ${BACKUP_PFAD}; ls -tr ${BACKUP_PFAD}/${BACKUP_NAME}* | head -n -${BACKUP_ANZAHL} | xargs rm; popd

    Make executable and move the script to /usr/bin/

    sudo chmod 755 /home/pi/
    sudo mv /home/pi/ /usr/local/bin/
    crontab -e
    00 01 * * * /usr/local/bin/

    Every day at 01:00 in the night a backup with crontab.

    Restore your Backup to your SD-Karte under Windows with Win32 Disk imager or with Linux with following command.

    dd if=/path/backup.img of=/dev/sda bs=1MB

    create manual a backup with your pi

    sudo dd if=/dev/mmcblk0 of=/yourBACKUPpath/Rpi_32gb_backup.img bs=2M

  • That’s what I love about this place!! Many hands make light work… 🙂

  • Very true! A big thank you to everybody who has helped me along the way. 👏 👍