First time Backup

First time restic back up. I am following the docs to do my first backup. Good job on the docs btw!

Blockquote

restic -r /srv/restic-repo --verbose backup ~/work

Blockquote

The repo directory is here: /run/media/orca/DataCabinet

So to back up my entire filesystem I would
[restic -r /srv/restic-/run/media/orca/Datacabinet --verbose backup ~/

Now it’s the ~/ I think I am messing up. I am trying to tell the machine to put the entire filesystem in the repo.
Does restic not include /proc /dev /sys in the back up to the repo?

The error is this

Blockquote
Fatal: unable to open config file: Stat: stat /srv/restic-repo/config: no such file or directory
Is there a repository at the following location?

Blockquote

Hmm, you seem to have messed most of everything up.

You have to initialize the repostory first. If you want the repo to be located in the directory /run/media/orca/Datacabinet you’d run restic -r /run/media/orca/Datacabinet init.

The path ~/ will be expanded to your home directory, which of course does not include /proc, /dev, /sys, etc (unless you have a very weird path to your home directory). If you want to back up your home directory, use restic -r /run/media/orca/Datacabinet backup ~.

1 Like

Thanks rawtaz, I created and initialized the repository and it worked.

then I noticed in your code was a small “c” in DataCabinet, so I changed to capitalized C and yup it worked. thanks alot!

I can see that 80GB are used in the DataCabinet.

Because I did a backup earlier using [sudo rsync -avx --delete / /run/media/orca/DataCabinet] I had files in the DataCabinet that were taking up space. I didn’t like how all the system files were not in one compressed file.

So I ran [rm -rf /run/media/orca/DataCabinet] to remove all files and repeat the [restic -r /run/media/orca/DataCabinet backup ~] command to complete a new backup but then I get:
[ Fatal: unable to open config file: Stat: stat /run/media/orca/DataCabinet/config: no such file or directory
Is there a repository at the following location?]

But wait how could the repository be there if I deleted everything? Is the repository an init file?

I don’t see any files when I look in the gui for the DataCabinet. So where is this repository?

I guess I am trying to overwrite the current repository. So each back up will have its own repository?

Hi @powerhouse,

I’m afraid that you deleted it when you ran rm -rf /run/media/orca/DataCabinet.

A restic repository comprises a number of files and directories sitting within the repository folder you specify. You can read about the repository format here. That structure was generated in the folder /run/media/orca/DataCabinet when you ran restic -r /run/media/orca/DataCabinet init. So, run that command once more, before you run your backup, and all should be well.

Not if you don’t delete the repository between backups :wink:. Initialize (init) a repository only once, then you can backup to that location muliple times: subsequent backups (called “snapshots” in restic terminology) will be added to the original repository.

Once you’re successfully backing-up, you can learn about how to restore data, and also the forget and prune commands for longer-term repository management.

While it can initially be quite a lot to get your head around, it should all start making sense pretty quickly! I’ve also found restic’s docs and community forum to be really helpful. Good luck, and welcome :slightly_smiling_face:

2 Likes

Thanks Nev,
[When I restic -r /run/media/orca/Datacabinet init]
I get:
“Fatal: create repository at /run/media/orca/Datacabinet failed: config file already exists”

This is what confused me last night. I look in the DataCabinet but there is nothing there. But the machine is telling me the repository is there. How come I can not see the repository in my gui file viewer?

So then I say, well if the machine tells me the repository is there let’s take a snapshot.

[restic -r /run/media/orca/DataCabinet backup ~]

Output:
“Fatal: unable to open config file: Stat: stat /run/media/orca/DataCabinet/config: no such file or directory
Is there a repository at the following location?”

I thought the config ie init file was already there?
Asking me if there is a repository there. Well the machine told me there was, but I don’t see one. scratches head

Only thing I can think of is maybe the initial set up files.
$ yum install yum-plugin-copr
$ yum copr enable copart/restic
$ yum install restic

Naw not there…

Well now I’m confused, too!

I note that you have a combination of upper- and lower-case DataCabinet and Datacabinet references above. Is that causing the confusion? Do you accidentally have 2 directories (one with a lower-case “c” containing an initialized repo, and the other uppercase “C” not)?

If you run restic init with a non-existent directory name, I think restic will make the directory. So did the lowercase one appear due to a typo in the init command?

I note that you have a combination of upper- and lower-case DataCabinet and Datacabinet references above. Is that causing the confusion?
negative

But yup, your right! jeepers, that’s three mistakes now I’ve made that were from case sensitivity.

So let’s run the command properly this time.
Bingo, worked flawlessly.