Staubgeborener / klipper-backup

Klipper backup script for manual or automated GitHub backups. Lightweight, pragmatic and comfortable.
https://klipperbackup.xyz
222 stars 46 forks source link

all goes well until Execute #16

Closed Heiko910 closed 8 months ago

Heiko910 commented 8 months ago

Hi there, I am stuck, I managed to follow the wiki, create a repository, a token, install moonraker support, initialize the Github repository, I was going to open the .env file but there was only a .env.example file. I went ahead and created a .env file and used the example as a template. I configured everything in this new .env file with proper path of all my config files.

Did I mention that I installed it not on a raspberry pi but on a inovato quadra. I corrected all the file path to the correct directories.

This here is what I am getting when I execute ~/klipper-backup/script.sh

~/klipper-backup/script.sh grep: /home/quadra/klipper-backup/.env: No such file or directory grep: /home/quadra/klipper-backup/.env: No such file or directory grep: /home/quadra/klipper-backup/.env: No such file or directory grep: /home/quadra/klipper-backup/.env: No such file or directory grep: /home/quadra/klipper-backup/.env: No such file or directory Reinitialized existing Git repository in /home/quadra/klipper-backup/.git/ WARNING: git-filter-branch has a glut of gotchas generating mangled history rewrites. Hit Ctrl-C before proceeding to abort, then use an alternative filtering tool such as 'git filter-repo' (https://github.com/newren/git-filter-repo/) instead. See the filter-branch manual page for more details; to squelch this warning, set FILTER_BRANCH_SQUELCH_WARNING=1. Proceeding with filter-branch...

Rewrite 65b48be32ed3d120c90bc2afb890831ed7f7b91b (1/42) (0 seconds passed, remaining 0 predicted) fatal: /.env: '/.env' is outside repository at '/home/quadra/klipper-backup/.git-rewrite/t' index filter failed: git rm -r --cached --ignore-unmatch "$parent_path"/.env On branch main Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean Username for 'https://github.com': Heiko910

Any help would be appreciated

Staubgeborener commented 8 months ago

Could you please show me the output of these two commands: ls -la /home/quadra/klipper-backup/ cat /home/quadra/klipper-backup/.env (hide your credentials/token) cat /home/quadra/klipper-backup/version

Heiko910 commented 8 months ago

I will get you that information when I get home tonight. I am usually able to VPN into my home network but last night I turn the printer including the inovato quadra off.

Heiko910 commented 8 months ago

Her is #1 ls -la /home/quadra/klipper-backup/ total 44 drwxr-xr-x 4 quadra quadra 4096 Oct 10 23:17 . drwxr-xr-x 41 quadra quadra 4096 Oct 12 00:17 .. -rw-r--r-- 1 quadra quadra 1327 Oct 10 23:16 .env -rw-r--r-- 1 quadra quadra 980 Oct 10 23:17 .env.example drwxr-xr-x 8 quadra quadra 4096 Oct 12 22:13 .git drwxr-xr-x 3 quadra quadra 4096 Oct 10 23:15 .github -rw-r--r-- 1 quadra quadra 17 Oct 10 23:15 .gitignore -rw-r--r-- 1 quadra quadra 2164 Oct 10 23:15 install.sh -rw-r--r-- 1 quadra quadra 432 Oct 10 23:15 README.md -rwxr-xr-x 1 quadra quadra 1251 Oct 10 23:15 script.sh -rw-r--r-- 1 quadra quadra 5 Oct 10 23:15 version

2 cat /home/quadra/klipper-backup/.env

github_token=gh**** github_username=H** github_repository=SV06-Klipper-Backup

path_printercfg=/home/quadra/printer_data/config/printer.cfg path_adxlmcucfg=/home/quadra/printer_data/config/adxlmcu.cfg path_moonrakercfg=/home/quadra/printer_data/config/moonraker.conf path_osskccfg=/home/quadra/printer_data/config/osskc.cfg path_CALIBRATIONcfg=/home/quadra/printer_data/config/cfgs/CALIBRATION.cfg path_crowsnestcfg=/home/quadra/printer_data/config/crowsnest.conf path_MECHANICAL_GANTRY_CALIBRATIONcfg=/home/quadra/printer_data/config/cfgs/MECHANICAL_GANTRY_CALIBRATION.cfg path_misc-macroscfg=/home/quadra/printer_data/config/cfgs/misc-macros.cfg path_PARKINGcfg=/home/quadra/printer_data/config/cfgs/PARKING.cfg path_TEST_SPEEDcfg=/home/quadra/printer_data/config/cfgs/TEST_SPEED.cfg path_Adaptive_Meshingcfg=/home/quadra/printer_data/config/cfgs/kamp/Adaptive_Meshing.cfg path_CALIBRATIONcfg=/home/quadra/printer_data/config/cfgs/kamp/KAMP_Settings.cfg path_Line_Purgecfg=/home/quadra/printer_data/config/cfgs/kamp/Line_Purge.cfg path_Smart_Parkcfg=/home/quadra/printer_data/config/cfgs/kamp/Smart_Park.cfg path_Voron_Purgecfg=/home/quadra/printer_data/config/cfgs/kamp/Voron_Purge.cfg

back up whole folder syntax:

path_klipperdata=/home/quadra/printer_data/

backup_folder=klipper

and here is #3 0.3.6

BTW I think it is now all working. A reboot of the quadra machine and a restart of klipper and the update function in klipper seems to be working. I checked and all the config files that I configured in the .env file are now actually being backed up.

As i mentioned initially there was no .env file but a .env.example. I just edited it and renamed it to just .env. I hope that is what needed to happen.

Please let me know if you see anything that is out of the ordinarry. Thanks Heiko

Staubgeborener commented 8 months ago

Good to hear. Your .env file looks correct for me.

But weird that you don't get a .env file. Normally, the installation process should create one. As a one last step (just to handle this .env problem), could explain exactly step by step how you have done this? Please don't answer with "i followed the wiki". For example you can simply give me the relevant output of history.

Btw, please use the markdown syntax for easier readability. You can put your codes into ` like this or with hightling syntax

#this is
"my"
code
Heiko910 commented 8 months ago

I don't know where to find the relevant history. This was my first time doing anything on a GitHub account and I literally followed your installation procedure. The changes to the configuration from pi to quadra were all after the fact. The markdown syntax is also completely new to me. I would have to read up on that first Sorry, nooby here.

On Fri, Oct 13, 2023, 01:53 Staubgeborener @.***> wrote:

Good to hear. Your .env file looks correct for me.

But weird that you don't get a .env file. Normally, the installation process https://github.com/Staubgeborener/klipper-backup/blob/main/install.sh#L34 should create one. As a one last step (just to handle this .env problem), could explain exactly step by step how you have done this? Please don't answer with "i followed the wiki". For example you can simply give me the relevant output of history.

Btw, please use the markdown syntax https://docs.github.com/de/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax for easier readability. You can put your codes into ` like this or with hightling syntax

this is"my"

code

— Reply to this email directly, view it on GitHub https://github.com/Staubgeborener/klipper-backup/issues/16#issuecomment-1761158082, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCTOP6HE2WIOTUCGCGN6SLTX7D6SLAVCNFSM6AAAAAA53M6CHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRRGE2TQMBYGI . You are receiving this because you authored the thread.Message ID: @.***>

Staubgeborener commented 8 months ago

Just type history in your terminal. This will output your last entered commands from the current user. You should see all commands from the installation procedure.

Staubgeborener commented 8 months ago

This is why I said "[...] the relevant output [...]". Maybe you want to consider deleting this post as you leaked your token, private email, etc. GitHub also does make a "post history", so you can also see after editing what the user posted/edited (your token for example).

So directly change the token I would say.

grafik

Heiko910 commented 8 months ago

I already changed my access token. But, yes, I guess this just above my head. It isn't working. I followed the last step in the wiki to execute the script and to add the macro to be able execute the script from within mainsail but now I get another error message in mainsail. Screenshot_2023-10-15-08-52-41-49_40deb401b9ffe8e1df2f1cc5ba480b12

Staubgeborener commented 8 months ago

The message in mainsail regarding updates corresponds to this issue. TLTR: You should be able to use this script for backup purpose, but you're not able to update it.

This is why i added a small hint in the wiki: grafik

Heiko910 commented 8 months ago

how do I reverse this install?

Staubgeborener commented 8 months ago

There is nothing which can be "reversed". This scripts creates a folder and that's it, there are no binaries which will be installed.

sudo rm -r ~/klipper-backup

And maybe delete the added lines in your moonraker.conf. That's pretty much it.

Heiko910 commented 8 months ago

I actually got it all working. I deleted my original repository including the access tokens, created a new one, followed the instruction of YouTuber that used your script and I went with the manual backup option and just added the macro. It actually backs all the files that I configured in .env to my new repository. Thanks for your replies, Heiko

On Mon, Oct 16, 2023, 00:07 Staubgeborener @.***> wrote:

There is nothing which can be "reversed". This scripts creates a folder and that's it, there are no binaries which will be installed.

sudo rm -r ~/klipper-backup

And maybe delete the added lines in your moonraker.conf. That's pretty much it.

— Reply to this email directly, view it on GitHub https://github.com/Staubgeborener/klipper-backup/issues/16#issuecomment-1763858194, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCTOP6CKMZVD4ID56RCEMPDX7TMJLAVCNFSM6AAAAAA53M6CHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRTHA2TQMJZGQ . You are receiving this because you modified the open/close state.Message ID: @.***>

Staubgeborener commented 8 months ago

one, followed the instruction of YouTuber that used your script

Now I'm interested, could you please post the link to this video. Maybe I can use it for the wiki or readme file if the quality is good enough.

Heiko910 commented 8 months ago

Here is the video. https://youtu.be/fR2jIegqv3A?si=7WV0zOjpMFDdrf-s

It worked. I actually now understand what .env file is for and that I should not share it with world. Thanks, Heiko

On Mon, Oct 16, 2023, 12:18 Staubgeborener @.***> wrote:

one, followed the instruction of YouTuber that used your script

Now I'm interested, could you please post the link to this video. Maybe I can use it for the wiki or readme file if the quality is good enough.

— Reply to this email directly, view it on GitHub https://github.com/Staubgeborener/klipper-backup/issues/16#issuecomment-1765127284, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCTOP6AOT7ER2TQH3OPXTUDX7WCAPAVCNFSM6AAAAAA53M6CHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRVGEZDOMRYGQ . You are receiving this because you modified the open/close state.Message ID: @.***>