Backup strategy for a tipical hosting server

Hi, I was wondering what might be the best strategy to backup a tipical hosting server, I mean a single server with:

  • several maildirs (lots of small text files)
  • some bigger files (eg. SQL dump of varius MySQL databases)
  • some other files (like the public_html of multiple users)

Is it better to create a repository for each “content type”, eg:

sftp://remoteip/mysqldumps

sftp://remoteip/vhosts
sftp://remoteip/maildirs

or can I put everything is the same repo, but with different tags? eg.

restic -r sftp://remoteip backup (public_html sources..) –tag vhosts
restic -r sftp://remoteip backup (mysqldump sources..) –tag dump

…?

Thank you very much :slight_smile:

I would say that the best strategy of any backup is to start backup things asap.

Start with the easiest option and backup everything into one repo. Restic will handle it without any issues IMO. And only if you discover that it does not work for whatever reason, think about complicating it:) Unless it is some huge organisation server with thousands of users/millions of emails and hundreds of gigabytes of databases data there is no point really to over engineer things.

Tagging different content is pretty good idea to keep things organised. Also handy to apply easily various retention policies for different data types if needed.

2 Likes

Reasons for using multiple repos imho:

  • Different retention policies for different content types
  • Maybe you want to rsync repos only for certain content types somewhere else (cloud?)
  • Possibility to later use separate locations or access permissions for different content types

Main reason for using a single repo imho: deduplication (if data chunks reappear across content types). This works extremely well and saves me a ton of space in nearly every repo I’ve ever created. As @kapitainsky said, restic doesn’t care about things like file number or size. No restrictions here until you get to a certain point.

2 Likes

Thank you @nicnab @kapitainsky, I really appreciate your thoughts!

2 Likes

I would highly suggest one repo with tags. Although, you can add tags later. Just start now.

1 Like