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.

    Question about backup script

    Scheduled Pinned Locked Moved General Discussion
    30 Posts 3 Posters 1.7k 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.
    • N Offline
      nowayto
      last edited by

      Hello,
      I have a question about backup script.
      In these days I’m trying to learn how to configure MM with some modules, after all these tries, I will do a fresh installation with no errors on configuration.

      When I’ll arrive at that point, I’ll wanna backup MM entirely, so I see your script:

      bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_backup.sh)” with any parms

      I don’t want a github private backup, I want just a local backup so does this script will backup every configuration on: $HOME/MM_backup ?
      I assume I’ll just have to copy that folder away and keep it secure?

      When I’ll need a restore I can start with an empty SD card, OS installation, MM installation script and then which of that 2 options?

      1- copy the MM_backup folder in $HOME, install modules I need and run your restore script
      (bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_restore.sh)” with any parms)

      2- copy the MM_backup folder in $HOME and just run the restore script

      Thanks in advance

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

        @nowayto restore, option 2 . restore will reinstall all the modules and copy any created files saved with them
        (What’s the point of having a restore tool if it doesn’t?)
        And restore will copy the GitHub repo down for you (part 1 of your option 2)

        now, on the github

        its the same as ‘copy the MM_backup folder someplace’

        backup also creates versions

        backup today and next week, and restore either one
        or one from last year

        github is free
        make a private repo

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        N 1 Reply Last reply Reply Quote 2
        • N Offline
          nowayto @sdetweil
          last edited by

          Perfect.
          Your right but since I’m not a programmer so sometimes I have some stupid doubts.
          I started with a simple idea and now in my mind I wanna make more than one MM, with differents setup but for now I need to learn the basics configuration, so I’m testing testing and testing more :)
          Reinstall from 0 and test again :)

          For example I hope it will be not to difficult to config css, I like the personalization it will offer but I’m scared about difficulties. But I’ll try for sure!

          Thank you again

          S 2 Replies Last reply Reply Quote 1
          • S Offline
            sdetweil @nowayto
            last edited by

            @nowayto also see my MMM-Config, it provides module install and all config

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            N 1 Reply Last reply Reply Quote 1
            • S Offline
              sdetweil @nowayto
              last edited by

              @nowayto css, learn the developers window.
              see the second link in my signature below

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              R 1 Reply Last reply Reply Quote 0
              • R Offline
                rkorell @sdetweil
                last edited by rkorell

                @sdetweil Dear Sam,
                seen backup/restore days ago and as the question arises here - I struggle with the commend line :-(

                bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_backup.sh)" -h
                

                works - I get some hints - same as on your github repo.

                bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_backup.sh)" -p
                

                doesn’t work?
                "illegal option '- ’ " is the error message.
                Where can I place the -p option?
                (inside the brackets I get an errormessage from curl …)

                This is also true if I add repo- and username and the token.
                There is my second question: how to pass the parameters?

                I’ve tried

                bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_backup.sh)" -p MagicMirror rkorell ghp_thisismyverylongandcryptictokenforgithub
                

                But with no luck.
                MagicMirror is a fresh created repo, rkorell is my username on GitHub - token is fresh created private token according your guidance in module description.

                Can you please help?

                Thanks a LOT -as always,
                Ralf

                R 1 Reply Last reply Reply Quote 0
                • R Offline
                  rkorell @rkorell
                  last edited by rkorell

                  @sdetweil ,

                  last trial (after digging in your script I understand that -p is not that correct…)
                  So I’ve figured out that reponame and username have their own prefix.
                  A prefix for the token is not present, so I assume user:token could be feasible.
                  So I came to

                  bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_backup.sh) -p -r MagicMirror -u rkorell:ghpthisismyverylongandcryptictokenforgithub"
                  

                  But this doesn’t work either…
                  So I’m desparately looking for the right place to put in the right parameters in the right manner.
                  Sorry for being this dumb…
                  Regards,
                  Ralf

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

                    @rkorell hm… I did

                    bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_backup.sh)" -h
                    

                    and got

                    -h takes optional parameters
                    
                    	 -s MagicMirror_dir
                    		default /Users/sam/MagicMirror
                    
                    	 -b backup_dir 
                    		default /Users/sam/MM_backup
                    
                    	 -m backup message 
                    		 any message (in quotes) that you would like to attach to this change for later info
                    		default none
                    
                    	 -p auto push to github (will need repo name, username,  user password or token
                    		default false
                    
                    	 -r github repository name (reponame)
                    		typically https://github.com/username/reponame.git
                    		default output of git remote -v (if set)
                    		 -r overrides the git remote setting
                    
                    	 -u github username
                    		default none
                    

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    S R 3 Replies Last reply Reply Quote 0
                    • S Offline
                      sdetweil @sdetweil
                      last edited by

                      @rkorell there was a typo in the help contents…

                      I NEVER ask for password/token… git will prompt if needed…
                      thus I cannot capture it in my script… a security confidence thing…

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

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

                        @rkorell -p by itself gives an error, will fix

                        in both scripts

                        -s is the MagicMirror folder
                        -b is the backup folder
                        -u is the github userid
                        -r is the repo name, short xxxx or long https:…/repo
                        if you use the long url, i will get the userid from there

                        in backup
                        -p is push if not specified script will NOT push to github
                        in restore
                        -f requests fetch the github repo. if not specified, the local -b folder will be used to restore from. if not found the script will abort

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

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