Read the statement by Michael Teeuw here.
Question about backup script
-
@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 -
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 tobash -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 -
@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
-
@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… -
@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 -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 -
@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