Local backup of remote server

Hi All,

I’m in need of a bit of help.

I’m trying to set up a backup flow for my VPS, and my approach was:

  1. I run a backup of e.g. /etc and other folders to /opt/backup – now I have to do this as root, because only root can access the backed up files
  2. and I would like to pull sync the repository to my home PC – I though I can do this with:
    1. connecting to it (via kopia connect sftp) as my regular user on the VPS
    2. and after that sync it to a filesystem repo on my home PC

Now 2.1 already has two issues:

  1. kopia cannot use my ssh-agent, can’t prompt for a password and I hate having a passwordless ssh-key file – but I created one
  2. my regular user cannot read 700/600 folders and files in the repo.

This all makes me feel I’m not using the right approach. I know I could push the sync out home – but that requires a lot of set-up, port fwds, some dns solution etc – again, probably not the right approach.

What would be the kopia way of doing this?

Appreciate any help!

Szabolcs

Kopia can only backup local files and directories. So if you want to pull data from a remote system you have to mount it locally.

You could mount the root directory of the remote server with sshfs:

mount -t sshfs server:/ /tmp/mountpoint

And the do the backup from /tmp/mountpoint

This is how I do it and it works very well.