Skip Navigation

How and where should I keep backups of system configurations?

Sorry for adding to the massive pile of backup-related question, but I could not figure out how to manage backups from existing answers..

I want to backup my VPS setup (think container-defining files, its volumes, and etc configs), but am unsure where to put it. Does keeping these in the VPS itself make sense? If so, how do I create and manage the backup?

Also, I would need a remote copy - what is the good location for this? I wish I could copy to my laptop, but obviously I cannot do that automatically. Should I pay money for a backup? I want to avoid paying lots of money just for backups. Thanks in advance!

27 comments
  • Better question: Have you looked into infrastructure as code? (IaaC) you can define everything in a Git repo and then create everything in a repeatable way.

  • Most of the time the VPS provider offers some backup solution. It's not only about your configuration files which can easily be recreated, but about all the user data like pictures databases, etc. Which once lost can't be recovered.

    Best practice is a 3-2-1 backup: https://www.backblaze.com/blog/the-3-2-1-backup-strategy/

    But you could back up your stuff on your laptop if you want, it's not such a bad idea actually. For that you trigger the backup script from your laptop, you can do it automatically there too. This makes sure that the laptop is on while you're doing the backup.

    The easiest way is a crown job and a bash file which runs a couple of rsync commands to get specific files and directories from the server via ssh.

    A more involved way would be a backup system like restic, which does a lot of things for you but is a bit more involved to set up.

  • Lots of good ideas.

    I'm a fan of stow-like tools, but there are advantages to using something like Salt (or similar) if you're dealing with VPSes that share don't common configs like firewalls. There's a lot to learn with things like salt/chef/puppet/attune/ansible, whereas something like yas-bdsm, which is what I'm currently using, is literally just:

    1. Keep your configs in a git repos, in a structure that mirrors your target
    2. Run a command and it creates symlinks for the destination files
    3. Commit your changes and push them somewhere. Or just restic-backup the repos.

    The config file formats are irrelevant; there's no transformation logic to learn. Its greatest feature is its simplicity.

27 comments