sdetweil / MagicMirror_scripts

Magic Mirror installation and setup scripts
337 stars 61 forks source link

Not sure if Issue or not #48

Closed Plainbroke closed 1 year ago

Plainbroke commented 1 year ago

Hey Sam, I get the following when I installed MagicMirror with your script and also when I tried to sudo apt update.

W: Failed to fetch https://packagecloud.io/Keymetrics/pm2/debian/dists/bullseye/InRelease 429 Too Many Requests [IP: 54.215.170.165 443] W: Some index files failed to download. They have been ignored, or old ones used instead.

Jeff

sdetweil commented 1 year ago

looks like the apt server is having trouble, too many requests

nothing I can do

Plainbroke commented 1 year ago

I understand that, I was just wondering if it was something on my end or everyone was experiencing the same issue. Did not look like it was a critical update, so I thought I would just ask.. You have been busy on MM forum today. So if I send a empty file ended at night to the motion folder in MMM-SleepWake that triggers the timer in config.js to blank screen? and then in the morning send empty file detected to the same motion folder in MMM-SleepWake it should turn the modules back on.

Jeff Burdick

From: sam detweiler Sent: Friday, July 15, 2022 2:25 PM To: sdetweil/MagicMirror_scripts Cc: Jeff; Author Subject: Re: [sdetweil/MagicMirror_scripts] Not sure if Issue or not (Issue#48)

looks like the apt server is having trouble, too many requests nothing I can do — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

sdetweil commented 1 year ago

@Plainbroke

So if I send a empty file ended at night to the motion folder in MMM-SleepWake that triggers the timer in config.js to blank screen? and then in the morning send empty file detected to the same motion folder in MMM-SleepWake it should turn the modules back on.

correct

if you just call the script MMM-SleepWake/external_motion with started or ended it will do the right thing

Plainbroke commented 1 year ago

Sam, I hope I am not being a bother. Will the attached install file work to reinstall from scratch all my modules.??? Can I add things like sudo cp RSTPStream RSTPStream2, sudo cp RSTPStream RSTPStream3, sudo cp RSTPStream RSTPStream4, sudo cp RSTPStream RSTPStream5 To the installscript.sh ? If so how? Trying to automate my reinstall as much as possible.

Jeff Burdick

sdetweil commented 1 year ago

no.. BUT, I have a repo that creates backup and restore

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

it saves config.js, custom.css

and then finds and saves all the GitHub links to the installed modules.

so 3 small files.

restore copies config.js, and custom.css to the new MagicMirror folder , and the installs all the modules in the saved list

additionally it creates a git repo that you can push to GitHub.and tags each backup with it's date.. so you could restore a particular instance.

each command supports --help

this installs outside the MagicMirror folder

Plainbroke commented 1 year ago

Hey Sam, I have been having trouble with backup restore not restoring the config.js or custom.css if I have done another backup since the original backup. It seems to keep the original config.js and custom.css which is not usually a big deal except for the restore then does not show some of the new modules I have tried. I am not sure if that is how it is supposed to work or not? So I have been backing those two files up manually once a week so I do not loose much that way if anything. The Custom.css is the most critical for me personally because of all the customization I have went through since starting this project a few years ago.
You all have helped and taught me so much it is unreal.. I sometimes have trouble with DOS now at work, yes we still use DOS to configure some things on copiers. I have trouble figuring out what I am doing wrong and then it dawns on me I am trying to use Linux or Unix commands on a DOS box.
Thank you for your patients with us newbies that do not quit get it sometimes. That has to be rough.. One last thought. Is there a way to set your backup restore script to alphabetize the modules list by the modules name? Just curious, it would make it easier for me to see if one of the current modules is not backed up yet..

Jeff Burdick

From: sam detweiler Sent: Saturday, August 20, 2022 8:14 PM To: sdetweil/MagicMirror_scripts Cc: Jeff; Mention Subject: Re: [sdetweil/MagicMirror_scripts] Not sure if Issue or not (Issue#48)

no.. BUT, I have a repo that creates backup and restore https://github.com/sdetweil/MagicMirror-backup-restore it saves config.js, custom.css and then finds and saves all the links to the installed modules. so 3 small files. restore copies config.js, and custom.css to the new MagicMirror folder , and the installs all the modules in the saved list additionally it creates a git repo that you can push to GitHub.and tags each backup with it's date.. so you could restore a particular instance. each command supports --help this installs outside the MagicMirror folder — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Plainbroke commented 1 year ago

Hey Sam, I am curious if I can backup to the GitHub some way with this backup restore module of yours?

Jeff Burdick

From: sam detweiler Sent: Saturday, August 20, 2022 8:14 PM To: sdetweil/MagicMirror_scripts Cc: Jeff; Mention Subject: Re: [sdetweil/MagicMirror_scripts] Not sure if Issue or not (Issue#48)

no.. BUT, I have a repo that creates backup and restore https://github.com/sdetweil/MagicMirror-backup-restore it saves config.js, custom.css and then finds and saves all the links to the installed modules. so 3 small files. restore copies config.js, and custom.css to the new MagicMirror folder , and the installs all the modules in the saved list additionally it creates a git repo that you can push to GitHub.and tags each backup with it's date.. so you could restore a particular instance. each command supports --help this installs outside the MagicMirror folder — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

sdetweil commented 1 year ago

ok, 1st message trouble with backup custom.css and config.js

by default the backup script uses from $HOME/MagicMirror to $HOME/MM_backup

you can change those with the -s and -b parms

as a test, do

cd ~/MagicMirror-backup-restore
bash -x mm_backup.sh >somefile.txt 2>&1

after it ends (quickly and quitely) nano somefile.txt

you should see this at the top

+ base=/home/sam/MagicMirror
+ saveDir=/home/sam/MM_backup
++ uname -s
+ mac=Linux
+ '[' Linux == Darwin ']'
+ cmd=readlink
+ msg_prefix=updating
+++ readlink -f ./mm_backup.sh
++ dirname /home/sam/MagicMirror-backup-restore/mm_backup.sh
+ script_dir=/home/sam/MagicMirror-backup-restore
+ getopts hs:b: opt
+ '[' '!' -d /home/sam/MM_backup ']'
+ '[' '!' -d /home/sam/MM_backup/.git ']'
+ repo_list=/home/sam/MM_backup/module_list
+ echo updating folder /home/sam/MM_backup
updating folder /home/sam/MM_backup
+ cp -p /home/sam/MagicMirror/config/config.js /home/sam/MM_backup
+ cp -p /home/sam/MagicMirror/css/custom.css /home/sam/MM_backup

with your home folder (/home/pi?) instead of mine (/home/sam)

of course, if the magicmirror folder is a different name than oops.. need to specify the -s $HOME/???? whatever the folder name is

and YOU have to run backup EVERY time you change anything.. (but it will keep a date ordered list of changes)

sort.. not really.. the sort command sorts them my author userid..

sdetweil commented 1 year ago

message with >I am curious if I can backup to the GitHub some way with this backup restore module of yours?

absolutely

create a repo on your github home page , click repositories in the top bar, then new then give it a name

you will get a list of commands

…
or push an existing repository from the command line

back on the pi do them (copy paste)

git remote add origin https://github.com/userid/reponame.git
git branch -M main
git push -u origin main

every backup is marked as a collection of changed files together, under a date/time tag

(base) sam@sams:~/MM_backup$ git tag 
21-Aug-2022-19-11-10
21-Aug-2022-19-11-11
21-Aug-2022-19-13-04
(base) sam@sams:~/MM_backup$ 

then back on the pi

u can checkout a tag and make a new branch with those files.. git checkout tagname -b branchname

git checkout 21-Aug-2022-19-11-11 -b new-f
Switched to a new branch 'new-f'

then to restore, from github

git clone https://github.com/userid/reponame.git a folder named reponame will be created with your files inside cd reponame

you can also rename while cloning git clone https://github.com/userid/reponame.git new_folder_name cd foldername

(checkout the tag u want, if not latest) then cd ~/MagicMirror_backup_restore (or whatever name you cloned to) ./mm_restore -b new_folder_name

or use the full pathname ~/MagicMirror_backup_restore/mm_restore -b new_folder_name

Plainbroke commented 1 year ago

Okay Sam, I made me repo https://github.com/Plainbroke/MM.git but I am getting errors using the list of steps on the repo on my MM pi. …or push an existing repository from the command line git remote add origin https://github.com/Plainbroke/MM.git git branch -M main git push -u origin main When I run the above I get @.:~ $ git remote add origin https://github.com/Plainbroke/MM.git fatal: Not a git repository (or any of the parent directories): .git @.:~ $ git branch -M main fatal: Not a git repository (or any of the parent directories): .git @.***:~ $ git push -u origin main fatal: Not a git repository (or any of the parent directories): .git Tried it on 2 different Pi’s and get the same thing. When I tried the -b in your backuprestore module it froze up the pi4 I use for my MM. I have to be doing something wrong but not sure where I am going wrong.

Jeff Burdick

From: sam detweiler Sent: Saturday, August 20, 2022 8:14 PM To: sdetweil/MagicMirror_scripts Cc: Jeff; Mention Subject: Re: [sdetweil/MagicMirror_scripts] Not sure if Issue or not (Issue#48)

no.. BUT, I have a repo that creates backup and restore https://github.com/sdetweil/MagicMirror-backup-restore it saves config.js, custom.css and then finds and saves all the links to the installed modules. so 3 small files. restore copies config.js, and custom.css to the new MagicMirror folder , and the installs all the modules in the saved list additionally it creates a git repo that you can push to GitHub.and tags each backup with it's date.. so you could restore a particular instance. each command supports --help this installs outside the MagicMirror folder — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Plainbroke commented 1 year ago

This worked and looks like yours only mine says pi instead of sam.

Jeff Burdick

From: sam detweiler Sent: Sunday, August 21, 2022 7:22 PM To: sdetweil/MagicMirror_scripts Cc: Jeff; Mention Subject: Re: [sdetweil/MagicMirror_scripts] Not sure if Issue or not (Issue#48)

ok, 1st message trouble with backup custom.css and config.js by default the backup script uses from $HOME/MagicMirror to $HOME/MM_backup you can change those with the -s and -b parms as a test, do cd ~/MagicMirror-backup-restore bash -x mm_backup.sh >somefile.txt 2>&1 after it ends (quickly and quitely) nano somefile.txt you should see this at the top

sdetweil commented 1 year ago

really about backup/restore which is improved, closing here