Trying to set up de-duplicated copy of repositories

Trying to get smarter about my backup strategy, I want to set up a copy of my local repositories (made to external hard drive) - to be kept on-site, and another copy to be kept off-site.

First, is this the best way for a mere non-professional home user to do backups? Any thoughts about this would be appreciated.

Now the problem I’m currently puzzled about:

Studying the restic docs [ Working with repositories — restic 0.12.0 documentation ] , it appears to me that I need to HAVE that second repository set up (initialized) before I can do a copy.

But then I read about the deduplication problem [ Working with repositories — restic 0.12.0 documentation ]. The docs appear to clearly state and show that the target repository must be initialized so that the chunker parameters of the source repo are used.

I try to do that:

tomc@tomc-Spin-SP513-54N:~/bkup$ restic -r /media/tomc/seagate-21/spin5/_restic-bkup/dropbox init --repo2 /media/tomc/seagate-4/__spin5-current-restic-copy/dropbox --copy-chunker-params
enter password for secondary repository: 
Fatal: unable to open config file: Stat: stat /media/tomc/seagate-4/__spin5-current-restic-copy/dropbox/config: no such file or directory
Is there a repository at the following location?
/media/tomc/seagate-4/__spin5-current-restic-copy/dropbox
tomc@tomc-Spin-SP513-54N:~/bkup$

restic appears to be seeking and not finding a config file at the target location - but that cannot exist unless there is a repo already set up there. That seems to contradict the docs.

But I try to play along and so set up a repo so it can find a config file…

tomc@tomc-Spin-SP513-54N:~/bkup$ restic init --repo /media/tomc/seagate-4/__spin5-current-restic-copy/dropbox
enter password for new repository: 
enter password again: 
created restic repository 229949af84 at /media/tomc/seagate-4/__spin5-current-restic-copy/dropbox

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.
tomc@tomc-Spin-SP513-54N:~/bkup$

Rerunning the command that was looking for that config file, I get this -

tomc@tomc-Spin-SP513-54N:~/bkup$ restic -r /media/tomc/seagate-21/spin5/_restic-bkup/dropbox init --repo2 /media/tomc/seagate-4/__spin5-current-restic-copy/dropbox --copy-chunker-params
enter password for secondary repository: 
repository 229949af opened successfully, password is correct
created new cache in /home/tomc/.cache/restic
Fatal: create repository at /media/tomc/seagate-21/spin5/_restic-bkup/dropbox failed: config file already exists

tomc@tomc-Spin-SP513-54N:~/bkup$ 

Clearly, I am misunderstanding something here, but I can’t see it.

What OUGHT I to be doing?

Just a quick thought regarding backup strategy: a local backup protects you against accidental data loss ("oops I didn’t mean to type rm -rf ~" and “wasn’t that line there two months ago?”) and hardware failure. An offsite backup adds disaster recovery (houses do unfortunately burn down; fireman speaking). Now if you add an offline backup (like an hdd in your drawer), you even add protection against hackers and malware.

I find the best way to achieve all this is running restic against a local hdd (or nas - I have a USB hdd connected to a Raspberry Pi) and then simply regularily rsync the whole repo to the other locations. Add some repo checks and regular forgetting and pruning and you’re good.

2 Likes

Thanks for your confirming thoughts on my strategy question. That use of rsync was my first try at duplication, but there were problems I couldn’t troubleshoot. I may try to use it again. I’m also looking at using clonezilla.

The second problem remains. I am going to extract that and post it separately. Should have done that in the first place.

Thanks for your response. Helpful!

1 Like