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

Questions about update

Scheduled Pinned Locked Moved Solved Troubleshooting
19 Posts 5 Posters 4.8k Views 6 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 Offline
    selyjohns
    last edited by Dec 29, 2021, 2:05 PM

    Just scripted what I want. Not externalized for the moment. Just a simple copy of modules folder and personnalized files.

    Sorry if it’s not perfect, but i’m not a developer :)

    #!/bin/bash
    
    #BACKUP FOLDER
    mkdir -p /var/backups/MM
    cd /var/backups/MM
    
    #OLD BACKUPS PURGE
    echo "--- PURGE TASK ---"
    echo "Check for existing backups..."
    nb_save=$(ls | wc -l)
    if [ $nb_save -gt 4 ]
    then
            oldest_folder=$(ls -lt | tail -1 | cut -d " " -f10)
            echo "Limit of 5 backups reach. Deleting of the oldest one : $oldest_folder"
            rm -rf "$oldest_folder"
            echo "DELETED."
    else
            echo "Limit of 5 backups doesn't reach, skip to backup task."
    fi
    
    #BACKUP
    echo "--- BACKUP TASK ---"
    echo "Starting..."
    d=$(date +%Y-%m-%d_%H:%M)
    mkdir -p $d
    cd $d
    cp /home/pi/MagicMirror/config/config.js config.js
    cp /home/pi/MagicMirror/css/custom.css custom.css
    cp /home/pi/MagicMirror/modules/default/compliments/compliments.json compliments.json
    cp /boot/config.txt config.txt
    mkdir -p modules
    cp -R /home/pi/MagicMirror/modules/ .
    echo "DONE. CURRENT LIST OF BACKUPS :"
    cd ..
    ls -A1
    
    S 1 Reply Last reply Dec 29, 2021, 2:33 PM Reply Quote 0
    • S Offline
      sdetweil @selyjohns
      last edited by Dec 29, 2021, 2:33 PM

      @selyjohns cool… mine saves the list of modules (git url) and config.js to a local git repo with a tag with the date

      other files (compliments.json) … cool… (any reason u didn’t put those in config.js?, u have to restart to use an updated file too)

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • S Offline
        selyjohns
        last edited by Dec 29, 2021, 2:39 PM

        @sdetweil said in Questions about update:

        @selyjohns cool… mine saves the list of modules (git url) and config.js to a local git repo with a tag with the date

        Perfect :) Git seem to be a good solution. For next evolution haha
        For the json, it’s because i’ve define a lot of compliments and it’s more clean on external json that in config.js

        S 1 Reply Last reply Dec 29, 2021, 2:50 PM Reply Quote 0
        • S Offline
          sdetweil @selyjohns
          last edited by Dec 29, 2021, 2:50 PM

          @selyjohns you can look at my backup script for creating the tag from the date/time

          https://github.com/sdetweil/MagicMirror-backup-restore

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 1 Reply Last reply Dec 29, 2021, 2:54 PM Reply Quote 0
          • S Offline
            selyjohns @sdetweil
            last edited by Dec 29, 2021, 2:54 PM

            @sdetweil Perfect ! Thanks :)

            1 Reply Last reply Reply Quote 0
            • B Offline
              BKeyport Module Developer @sdetweil
              last edited by Dec 29, 2021, 6:03 PM

              @sdetweil Whoops. that’s 90% of my mirror! Without CSS copied it becomes a big mess quick. Only modules I don’t have custom CSS for is MMM-Multimonth and MMM-Worldclock (Hmm, wonder why? 😀)

              The "E" in "Javascript" stands for "Easy"

              S 1 Reply Last reply Dec 29, 2021, 6:05 PM Reply Quote 0
              • S Offline
                sdetweil @BKeyport
                last edited by Dec 29, 2021, 6:05 PM

                @bkeyport fixed

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                B 1 Reply Last reply Dec 29, 2021, 6:07 PM Reply Quote 0
                • B Offline
                  BKeyport Module Developer @sdetweil
                  last edited by Dec 29, 2021, 6:07 PM

                  @sdetweil Slick script by the way, I gotta steal a few things from it. :)

                  The "E" in "Javascript" stands for "Easy"

                  1 Reply Last reply Reply Quote 1
                  • 1
                  • 2
                  • 2 / 2
                  2 / 2
                  • First post
                    16/19
                    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