Closed B1ueOne closed 2 months ago
This is a weird thing:
------------DEBUG:------------
$backup_path/.git/config:
[init]
defaultBranch =
------------------------------
I just deleted my whole klipper-backup and config_backup folder, cloned this repository and run the install.sh
. After running script.sh
my .git config looks like this:
------------DEBUG:------------
$backup_path/.git/config:
[init]
defaultBranch = main
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[user]
name = klipperbackup
email = klipperbackup@kubuntu-vm
[remote "origin"]
url = https://********@github.com/Staubgeborener/klipperbackupstagingtest.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
remote = origin
merge = refs/heads/main
------------------------------
And for context, running script.sh
works like a charm:
● Checking for installed dependencies Done!
Klipper-Backup is up to date
Von https://github.com/Staubgeborener/klipperbackupstagingtest
* branch main -> FETCH_HEAD
Bereits aktuell.
Auf Branch main
Ihr Branch ist auf demselben Stand wie 'origin/main'.
nichts zu committen, Arbeitsverzeichnis unverändert
[main 767a1d9] New backup from 11.09.2024 - 12:32:02 - No new changes pushed
Objekte aufzählen: 1, fertig.
Zähle Objekte: 100% (1/1), fertig.
Schreibe Objekte: 100% (1/1), 217 Bytes | 217.00 KiB/s, fertig.
Gesamt 1 (Delta 0), Wiederverwendet 0 (Delta 0), Pack wiederverwendet 0
To https://github.com/Staubgeborener/klipperbackupstagingtest.git
e65ccfd..767a1d9 main -> main
Branch 'main' folgt nun 'origin/main'.
The script.sh
just checks if the .git
directory exists and initialize it otherwise (source). My first idea, there is a old and wrong .git/config
file in your config_backup
folder. Did you really run sudo rm -rf ~/config_backup
or maybe something like
klipperbackup@kubuntu-vm:~$ cd ~/backup_config
klipperbackup@kubuntu-vm:~/config_backup$ rm *
as this will not delete hidden files and directory like .git
?
Otherwise run all of these commands in the same order and show me the whole output:
cat ~/config_backup/.git/config
cat ~/klipper-backup/.env #(hide your token!)
~/klipper-backup/script.sh --fix
~/klipper-backup/script.sh
pi@VzBot:~ $ cat ~/config_backup/.git/config
[init]
defaultBranch =
pi@VzBot:~ $ ~/klipper-backup/script.sh --fix
● Checking for installed dependencies Done!
● Delete config_backup folder Done!
pi@VzBot:~ $ ~/klipper-backup/script.sh
● Checking for installed dependencies Done!
Klipper-Backup is up to date
Initialized empty Git repository in /home/pi/config_backup/.git/
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
remote: Enumerating objects: 616, done.
remote: Counting objects: 100% (46/46), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 616 (delta 18), reused 35 (delta 10), pack-reused 570 (from 1)
Receiving objects: 100% (616/616), 187.14 KiB | 2.40 MiB/s, done.
Resolving deltas: 100% (372/372), done.
From https://github.com/B1ueOne/KlipperBackup
* branch main -> FETCH_HEAD
* [new branch] main -> origin/main
Skipping symbolic link: printer_data/config/mainsail.cfg
Skipping symbolic link: printer_data/config/timelapse.cfg
[main 064263e] New backup from 11/09/24 - 12:49:52
6 files changed, 676 insertions(+), 591 deletions(-)
create mode 100644 printer_data/config/crowsnest.conf
create mode 100644 printer_data/config/moonraker.conf.backup
rewrite printer_data/config/printer.cfg (72%)
delete mode 100644 printer_data/config/spyglass.conf
From https://[MYTOKEN]@github.com/B1ueOne/KlipperBackup.git
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 4 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (9/9), 15.35 KiB | 2.19 MiB/s, done.
Total 9 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To https://github.com/B1ueOne/KlipperBackup.git
1f3cf80..064263e main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.
pi@VzBot:~ $
Strange, now it works somehow? I believe the only difference between this attempt and my last attempts is, this time I haven't used "sudo" as per your instructions.
Well, the --fix
parameter deleted your whole config_backup
folder with a simple rm -rf $HOME/$backup_folder
command. After that, running script.sh
leads the code into creating a fresh new .git/config
file as the old one is deleted.
I can only assume, that you didn't really deleted it with rm -rf ~/config_backup
but with a cd ~/config_backup && rm *
'ish command, which means you didn't deleted the hidden content inside this directory. But nevertheless, the script should still check the content of the .git/config
file and adjust the stuff if needed. Weird.
But glad its working on your side.
Code of Conduct
code
more readable which helps to fix the problem and that I have tested the--fix
command mentioned above without success.What happened
Klipper-Backup stopped syncing 5 months ago. Today I decided to try and fix it.
What I've tried:
and yet I keep getting the same error when executing the script:
What did you expect to happen
successful backup to my repo.
How to reproduce
run the script.sh
Debug
Additional information
No response