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.

    What is your backup and restore method?

    Scheduled Pinned Locked Moved Troubleshooting
    18 Posts 10 Posters 6.3k Views 15 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.
    • bheplerB Offline
      bhepler Module Developer
      last edited by

      The only information that is unique to my mirror is the module configuration. I just back up the config.js file whenever I make a change to the mirror configuration. If the mirror needs to be rebuilt, I can quickly build a slick Buster installation, SSH into the Pi, run the installation script, drop the backup config.js to the config folder and then do a half-dozen git clone commands.

      Once the mirror is up & running, I can do the boring maintenance stuff (apt get update && apt get upgrade) and just let it run in the background.

      1 Reply Last reply Reply Quote 1
      • LusbuebL Offline
        Lusbueb @swvalenti
        last edited by Lusbueb

        @swvalenti on my Netgeras ReadyNAS i have enabled NFS and SMB and a Share named backup (everyone has full-access)

        07cc27f0-c849-4a19-9028-df4b36274fbf-image.png

        i start the raspibackup.sh-Script with this helper-Script named raspiBackupNfsWrapper.sh

        #!/bin/bash
        
        #######################################################################################################################
        #
        # 	Sample script which checks whether a nfsserver is available and exports a specific directory
        # 	and then starts raspiBackup
        #
        #######################################################################################################################
        #
        #   Copyright # (C) 2017,2018 - framp at linux-tips-and-tricks dot de
        #
        #   This program is free software: you can redistribute it and/or modify
        #   it under the terms of the GNU General Public License as published by
        #   the Free Software Foundation, either version 3 of the License, or
        #   (at your option) any later version.
        #
        #   This program is distributed in the hope that it will be useful,
        #   but WITHOUT ANY WARRANTY; without even the implied warranty of
        #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        #   GNU General Public License for more details.
        #
        #   You should have received a copy of the GNU General Public License
        #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
        #
        #######################################################################################################################
        
        NFSSERVER="192.168.192.10"
        NFSDIRECTORY="/c/backup"
        MOUNTPOINT="/backup"
        
        VERSION="0.0.3"
        
        # add pathes if not already set (usually not set in crontab)
        
        if [[ -e /bin/grep ]]; then
           PATHES="/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin"
           for p in $PATHES; do
              if ! /bin/grep -E -q "[^:]$p[:$]" <<< $PATH; then
                 [[ -z $PATH ]] && export PATH=$p || export PATH="$p:$PATH"
              fi
           done
        fi
        
        function cleanup() {
        	umount -f $MOUNTPOINT
        }
        
        trap cleanup SIGINT SIGTERM EXIT
        
        if ping -c1 -w3 $NFSSERVER &>/dev/null; then
        	if showmount -e $NFSSERVER | grep -q $NFSDIRECTORY; then
        		echo "Mouting $NFSSERVER:$NFSDIRECTORY to $MOUNTPOINT"
        		mount -t nfs -o soft,vers=3 $NFSSERVER:$NFSDIRECTORY $MOUNTPOINT
        		if (( $? > 0 )); then
        			echo "Failed to mount $NFSSERVER:$NFSDIRECTORY"
        			exit 42
        		fi
        		raspiBackup7412.sh
        		rc=$?
        		if (( $rc > 0 )); then
        			echo "raspiBackup failed with rc $rc"
        			exit $rc
        		fi
        	else
        		echo "Server $NFSSERVER does not provide $NFSDIRECTORY"
        		exit 1
        	fi
        else
        	echo "Server $NFSSERVER not online"
        	exit 1
        fi
        
        

        Will this be helpfull for you?

        Regards Peter

        1 Reply Last reply Reply Quote 1
        • LusbuebL Offline
          Lusbueb @BillyTheKid9588
          last edited by

          @BillyTheKid9588 yes, in the raspiBackup.conf i have this to lines to stop an start MM:

          
          # commands to stop services before backup separated by &
          DEFAULT_STOPSERVICES="sudo -u pi pm2 stop mm && systemctl stop lighttpd"
          
          # commands to start services after backup separated by &
          DEFAULT_STARTSERVICES="systemctl start lighttpd && sudo -u pi pm2 start mm"
          
          

          Will this be helpfull for you?

          Regards Peter

          1 Reply Last reply Reply Quote 1
          • C Offline
            Cyric
            last edited by

            For my backup I tried to just make an image of my card, so if something were to ever go wrong, I could just reimage my card and it would work. Well, we lost power yesterday, and something went wrong. I formatted the card, re imaged it, and it eventually booted after some errors. The problem was that my config.js was corrupted or something, because I couldn’t edit it anymore. I’ve tried to reimage it again, but i’ve now gotten a different set of errors and a debian load screen i’ve never seen before. No idea where I went wrong.

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @Cyric
              last edited by sdetweil

              @Cyric there is a false sense of security w sd cards. the memory technology used is write once. the bits cannot be reused

              the software does not know this… the hardware does the work under the covers and say Success!
              even when its not.

              once the bits are used, the card is dead. may turn read only or may start exhibiting corrupted files ( the software does not know)

              this technology is great for cameras and music, low write activity… not so much for os’s that page, write log files… or apps like mm that constantly cause log files

              I think, based on your description your card is used up. time for a new one…

              I changed my pis to boot from SD card, but run from ssd (same technology, just really bigger)

              ps. I have lost 10 sd cards to this problem over the last 4 years…

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              P 1 Reply Last reply Reply Quote 1
              • P Offline
                pastormingle @sdetweil
                last edited by

                @sdetweil I have a 32gb UHS-I that has my current configuration that I wanted to backup and also clone it to a new ssd that is same type and size… My question is this I have cloned it but when I copy it to the new ssd it says that it isn’t the same sizes… But it is the same type of card… Can the image be reduced? What can I do to clone to a new ssd?

                cowboysdudeC 1 Reply Last reply Reply Quote 0
                • cowboysdudeC Offline
                  cowboysdude Module Developer @pastormingle
                  last edited by

                  https://www.raspberrystreet.com/learn/how-to-boot-raspberrypi-from-usb-ssd

                  There may be an easier way but this helped me.

                  swvalentiS 1 Reply Last reply Reply Quote 1
                  • swvalentiS Offline
                    swvalenti Project Sponsor @cowboysdude
                    last edited by

                    @cowboysdude said in What is your backup and restore method?:

                    https://www.raspberrystreet.com/learn/how-to-boot-raspberrypi-from-usb-ssd

                    There may be an easier way but this helped me.

                    @cowboysdude You the man that worked well for me and easy to follow!

                    cowboysdudeC 1 Reply Last reply Reply Quote 1
                    • cowboysdudeC Offline
                      cowboysdude Module Developer @swvalenti
                      last edited by

                      @swvalenti Yes but this ONLY works for an RPI4… So I KNOW someone is going to see this and try it on a 3 and come back with ‘it doesn’t work’… it does.

                      You can also do it on a 3 but it’s different…

                      https://thepi.io/how-to-boot-your-raspberry-pi-from-a-usb-mass-storage-device/

                      Just replying here so I can save myself trouble when someone tries it LOL

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 2 / 2
                      • 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