Meta information at locks?

Hi,

I am running restic in a few dozen jobs on different Kubernetes clusters. With that the backup job’s hostname is quite random. Unfortunately, the hostname and the creation timestamp is almost the only information attached to locks. Or is it not? This makes it quite difficult to identify the right job that has the repository locked right now. I’d like to attach some additional information, eg. the namespace and environment the job is running on. Maybe a bit similar to tags on snapshots? Not sure.

Is that possible? Or any other advice? Thanks a lot in advance.

Kind regards,
Frank.

I’m guessing that this is what you can get out of a lock:

$ restic list locks
repository ba330420 opened (version 1)
f962a13e079718b662d32462bceb1925e8e07012dde4ae076a366005ffa8724b

$ restic --no-lock cat lock f962a13e079718b662d32462bceb1925e8e07012dde4ae076a366005ffa8724b
repository ba330420 opened (version 1)
{
  "time": "2023-10-06T23:03:13.463116+02:00",
  "exclusive": true,
  "hostname": "myhost",
  "username": "myuser",
  "pid": 7814,
  "uid": 510,
  "gid": 20
}

This information will be reported (as a string) when there’s a lock preventing the action you want to take, e.g. backing up when there’s an exclusive lock.

Thanks, but none of that information is helpful to find the right cluster, datacenter, region, continent, planet, universe… Okay, I’m exaggerating. :wink:

1 Like

As you already said I, you can use tags on snapshots to indicate all your planets and galaxies if it helps you navigate the void which is Kubernetes :stuck_out_tongue:

Additionally, I want to point out that you can also override the hostname when creating a snapshot – if you keep it consistent your use for this container (or whatever it’s called, I have no knowledge of k8) then you can have it be more human readable.

1 Like