• 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.

Question about backup script

Scheduled Pinned Locked Moved General Discussion
30 Posts 3 Posters 1.8k 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.
  • S Away
    sdetweil @rkorell
    last edited by sdetweil Mar 13, 2025, 1:54 PM Mar 2, 2025, 9:39 PM

    @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 Mar 2, 2025, 9:57 PM Reply Quote 0
    • S Away
      sdetweil @sdetweil
      last edited by Mar 2, 2025, 9:57 PM

      @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 Away
        sdetweil @sdetweil
        last edited by sdetweil Mar 3, 2025, 2:15 PM Mar 2, 2025, 10:16 PM

        @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
        • N Offline
          nowayto @sdetweil
          last edited by Mar 2, 2025, 10:53 PM

          @sdetweil said in Question about backup script:

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

          I give it a try some days ago, after your suggestion but I wanna learn the configuration first, rather than easier ways

          I’ll read your CSS guide for sure

          S 1 Reply Last reply Mar 2, 2025, 11:14 PM Reply Quote 1
          • S Away
            sdetweil @nowayto
            last edited by Mar 2, 2025, 11:14 PM

            @nowayto yes, providing helpful tools hides the detail. a double edged sword

            my objective is to help you get results.

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            N 1 Reply Last reply Mar 2, 2025, 11:25 PM Reply Quote 1
            • N Offline
              nowayto @sdetweil
              last edited by Mar 2, 2025, 11:25 PM

              @sdetweil and I really thank you for that.
              Thanks to you even more people will try MM and appreciate your work.
              On my side I’m there to learn something new.
              It’ more challenging but it’s also more interesting so I’d prefer manual ways.
              Thanks a lot for your help, I’ll really appreciate that

              1 Reply Last reply Reply Quote 0
              • R Offline
                rkorell @sdetweil
                last edited by Mar 3, 2025, 12:23 PM

                @sdetweil said in Question about backup script:

                hm… I did

                Dear Sam (@sdetweil),
                yes - this worked for me as well :-)

                Now figured out how it works:

                Have issued

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

                Then I was asked for username and password (twice) and git upload worked…
                It seems git upload now contains a copy of local directory mm_backup.

                If I check both, there are only a few directoris in Github as well as locally - much fewer than total number of installed modules…
                What is the criterium for a module to “earn” a directory or not?

                Thanks a lot!

                Warmest regards,
                Ralf

                S 1 Reply Last reply Mar 3, 2025, 1:45 PM Reply Quote 0
                • S Away
                  sdetweil @rkorell
                  last edited by sdetweil Mar 3, 2025, 4:06 PM Mar 3, 2025, 1:45 PM

                  @rkorell the backup copies the url of the module source

                  where you cloned from,
                  see git remote -v in any module folder

                  now some modules create files, token.json for example
                  if i find extra files i need a place to store them, so the module name for a folder is created

                  the module_list file contains the list of modules needed
                  and their urls. they are reinstalled

                  the readme says this

                  this is not a binary backup

                  you can use this to move to a new system or new sd card (changing processor architectures too, pc to pi, pi to pc… whatever)

                  yes the folder MM_backup by default is a git source repository
                  and git will track any changes (new backup differences)

                  each time you back up, i create a marker to label this event, in git called a tag

                  and you can restore any one of those and compare two tags to see the difference

                  the private repo is because the files are saved in source form, and contain apikeys and maybe other credentials

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  S R 2 Replies Last reply Mar 3, 2025, 2:00 PM Reply Quote 1
                  • S Away
                    sdetweil @sdetweil
                    last edited by Mar 3, 2025, 2:00 PM

                    @rkorell you got prompted twice for username because git needs to know who you are and how to reach you if there are concerns about your “commit” to the repo. you csn see this in git log
                    output in the backup folder
                    this is username and email address

                    then the push , github needs to know . this is the password prompt from git

                    you could use git config to save those, and avoid the prompts

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    R 1 Reply Last reply Mar 3, 2025, 3:55 PM Reply Quote 0
                    • R Offline
                      rkorell @sdetweil
                      last edited by Mar 3, 2025, 3:55 PM

                      @sdetweil said :

                      you could use git config to save those, and avoid the prompts

                      Sounds cool.
                      How can I do this?

                      Thanks!
                      Ralf

                      S 1 Reply Last reply Mar 3, 2025, 3:57 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 2 / 3
                      2 / 3
                      • First post
                        12/30
                        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