Read the statement by Michael Teeuw here.
Question about backup script
-
@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 therein 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 -
@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
-
@nowayto yes, providing helpful tools hides the detail. a double edged sword
my objective is to help you get results.
-
@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 -
@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 -pThen 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 -
@rkorell the backup copies the url of the module source
where you cloned from,
see git remote -v in any module foldernow 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 createdthe module_list file contains the list of modules needed
and their urls. they are reinstalledthe 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
-
@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 addressthen 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
-
@sdetweil said :
you could use git config to save those, and avoid the prompts
Sounds cool.
How can I do this?Thanks!
Ralf -
@rkorell google is your friend
how to use git config
-
@sdetweil said in Question about backup script:
if i find extra files i need a place to store them, so the module name for a folder is created
Thanks for this explanation - this is what I had assumed.
Regards,
Ralf -
@sdetweil said in Question about backup script:
how to use git config
OK, thanks.
I had understood that this is a config of your scripts, sorry. -
@rkorell no… you can store config settings for git (the source code repository tool MagicMirror uses and most modules use (…git clone))
and the way to make the repository that the backup uses -
@sdetweil as far as google told me it seems, I need to install Git CLI - which is not easy available for Raspi.
Any hint?
Sorry!
Ralf -
O.K,. Google is not my friend today…
It seems that a “.gitconfig” file will do the trick …
Will double check. -
Nope.
Doesnt’t work.
Have created a “.gitconfig” file withgit config --global --editEntered user, email and password - but your script asks again for “user” …
???
Thanks
Ralf -
@rkorell the SCRIPT does not prompt
I use these git config parms
if [ "$user_name." == "." ]; then # prompt for users name git config --local user.name $user_name else git config --local user.name $user_name fi if [ "$email." == "." ]; then # prompt for email address git config --local user.email $email else git config --local user.email $email figit will prompt
-
@rkorell you HAVE the git cli
git --help
(–local means in this folder only)git config --local user.name “your name”
git config --local user.email “your email”see here
https://stackoverflow.com/questions/35942754/how-can-i-save-username-and-password-in-git
and username means github userid
-
@sdetweil said in Question about backup script:
@rkorell the SCRIPT does not prompt
I use these git config parmsOK, where do you get this from?
If I have a look at your other post „local means this folder only“ let me assume that you may look at „$HOME/MagicMirror/.gitconfig“
Is this true?
Than this cannot work because mygit config --global --editcreated a .gitconfig in $HOME …
Will at least try your suggestion with git config … (THANKS for this - the stackoverflow article will be chacked as well)
Warmest regards,
Ralf
-
@rkorell if you don’t have a global ($HOME) git config,
i dont presume to decide this for you.
so i only set it in the MM_backup folder -
@rkorell git will look local first and global second
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login