• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Backing Up Magic Mirror

Scheduled Pinned Locked Moved General Discussion
8 Posts 3 Posters 6.2k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    cowboysdude Module Developer
    last edited by Feb 8, 2017, 9:33 PM

    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 :)

    1 Reply Last reply Reply Quote 0
    • A Offline
      AAPS
      last edited by Feb 8, 2017, 9:40 PM

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

      C 1 Reply Last reply Feb 8, 2017, 9:42 PM Reply Quote 0
      • C Offline
        cowboysdude Module Developer @AAPS
        last edited by Feb 8, 2017, 9:42 PM

        @AAPS Here’s a nice guide for you :)

        https://www.raspberrypi.org/forums/viewtopic.php?p=239331

        1 Reply Last reply Reply Quote 2
        • A Offline
          AAPS
          last edited by Feb 8, 2017, 9:44 PM

          Oh. I understand now.

          L 1 Reply Last reply Feb 10, 2017, 9:10 PM Reply Quote 1
          • L Offline
            lolobyte @AAPS
            last edited by lolobyte Feb 10, 2017, 9:15 PM Feb 10, 2017, 9:10 PM

            @AAPS

            sudo nano /home/pi/Backup.sh
            
            #!/bin/bash
            
            # VARIABLEN - HIER EDITIEREN
            BACKUP_PFAD="/yourBACKUPpath"
            BACKUP_ANZAHL="5"
            BACKUP_NAME="raspicam3-HN_BMGT"
            DIENSTE_START_STOP="service mysql"
            # ENDE VARIABLEN
            
            # Stopp any services before backup
            ${DIENSTE_START_STOP} stop
            
            # 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
            ${DIENSTE_START_STOP} start
            
            # 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/Backup.sh
            sudo mv /home/pi/Backup.sh /usr/local/bin/Backup.sh
            
            crontab -e
            
            
            00 01 * * * /usr/local/bin/Backup.sh
            

            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
            
            1 Reply Last reply Reply Quote 2
            • C Offline
              cowboysdude Module Developer
              last edited by Feb 20, 2017, 12:23 PM

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

              1 Reply Last reply Reply Quote 0
              • A Offline
                AAPS
                last edited by Feb 20, 2017, 1:16 PM

                Very true! A big thank you to everybody who has helped me along the way. :clap: :thumbsup:

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy