Not a valid repository, check repo config #593
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#593
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Install borgmatic for the first time to handle my backups
Steps to reproduce (if a bug)
This is on my first ever install
Actual behavior (if a bug)
Expected behavior (if a bug)
Other notes / implementation ideas
Environment
borgmatic version: 1.5.1
Use
sudo borgmatic --version
orsudo pip show borgmatic | grep ^Version
borgmatic installation method: sudo apt install
Borg version: 1.1.15
Use
sudo borg --version
Python version: 3.8.10
Use
python3 --version
Database version (if applicable): [version here]
Use
psql --version
ormysql --version
on client and server.operating system and version: Ubuntu 20.04.5
Just trying to learn borg and was suggested to use borgmatic off the start. After going through the installation method on the how to page and the first time trying to create a backup, I get stuck with the error mentioned.
Not sure what to do here, tried googling around but cant find anything related to it except similar errors for local paths, not that path on borgbase.
Hope someone can help me out. Thanks
Welcome to borgmatic! The problem you're seeing may be that the Borg repository hasn't been initialized/created yet. For instance, have you tried something like this before your
create
?borgmatic init --verbosity 1
This creates the configured repository on disk so that you have a place to backup to.
Also note that the version of borgmatic you're using is pretty old (3 years!), so please considering upgrading if you'd like new features and bug fixes. I realize that OS repositories are often out of date, but you can install with
pip
or via another method.This is the response I get, even if no sudo.
Oh, my bad! You'll need to specify an encryption type when initializing a repository. For example:
See the Borg documentation for more information about your encryption options:
https://borgbackup.readthedocs.io/en/stable/usage/init.html#encryption-mode-tldr
That command did the trick, thanks! But I am running into something else now. After running the init command, then the create command I listed in my OP, I logged off and connected somewhere else to my server and had to use the init command again. Is that normal? I assumed it was only once.
Also, after doing the init command again on the second login, I ran the create command again and borg reuploaded the single directory that I have in the config, just a test dir with a test text file. I thought out of the box that borg would only back up any changes? Am I missing something in the yaml to do this?
My goal is to backup my whole system to create a system image essentially.
Thanks for the help so far!
It's not normal! You should only have to initialize the repository once. Not sure what was going on there if the repository path didn't change within borgmatic's configuration file. Maybe the repository was created in a temporary directory or other location that got deleted between logins?
It sounds like after your second login, you created (
init
ed) a completely new repository, so Borg was effectively starting over "from scratch." If you'd like to only backup any changes, you'd have to make sure you're using the same repository from onecreate
to the next.Not sure how I wouldve done that if I did.
My source is set to /home/ccigas/borgtest
My repo is just copied from borgbase: ssh://host@host.repo.borgbase.com/./repo
I have my encryption passphrase filled in, my ssh_command filled in for the private key. And lastly is the default retention of 7 days, no other changes from the default config file.
So this morning I just tried doing the create command again, did not have to use the init command so thats a plus. But still seems like its creating multiple back ups? Is this because of archive name format always being different by using the default setting?
So at the moment I ran the script three times on the test directory that hasnt changed once and when I list the archive there are three archives listed. Not really sure what I am doing wrong to be honest.
Borg creates a new archive everytime you call
create
. This serves as a snapshot of a particular point in time. However, if nothing has changed on disk, then the archive takes up almost no additional space on disk. The way you can verify this is by including the--files
flag withcreate
and looking at the list of files added/modified/etc. each time you run borgmatic. Hope this helps.Sorry I took so long to answer back. I ran the
--files
flag and this is my output. The line with the text file listed, does this mean that its working as expected since nothing changed in the directory or file?The
A
in theA /home/ccigas/borgtest/test.txt
line means that text file was newly added. If you try runningcreate
again, it should no longer show up in the listing as it'll be unchanged. (borgmatic suppresses unchanged files from the listing.) Then, if you modify the file, it'll show up asM
for modified.Here are all the letter codes: https://borgbackup.readthedocs.io/en/stable/usage/create.html#item-flags
Just got back into this, I did the same command again as in my previous reply and I still see an A before the text file location. Not sure what I am doing wrong. Should I just post my config?
Sure, feel free to post your config (with any secrets or sensitive information redacted). I'm not sure what might be causing the behavior you're seeing though. Even if your repository is append-only on Borgbase, that still wouldn't cause your test file to be "added" repeatedly.
Thanks, posted it to pastebin so its not making this too long.
https://pastebin.com/gm9j1isC
I don't see anything in your configuration file that might lead to the behavior you're seeing, but I did find this hightly relevant Borg FAQ entry: I am seeing ‘A’ (added) status for an unchanged file!?
It sounds like the behavior you're seeing is perfectly normal (but confusing!), and nothing is being duplicated in storage.
Oh nice thanks! Time to learn how to do a full OS backup and restore now then.
Thanks for the help!
Sure thing!