How Restic can create a backup in tar ball

I wonder how restic creates tarball…

Of course you can run tar command by using kubectl exec <podname> -- tar cf - <dir> , but it requires that each application pods need to have tar command.
So, cannot restic can take a backup if application pods don’t have tar command?
Or, does restic take another way to do that?

I assume you’re talking about dump command, I am not sure if there is any other tar-providing feature. (You were saying “taking the backup”, it doesn’t create tars at this step as far as I know).
It looks like it uses golang’s tar library: also relevant code piece here
So no, it should not need tar command to be available.

Basically, I am using restic with velero.

So Restic prepares the backup in form of tar ball and send it to the velero.

That’s why I am asking how Restic prepare the backup of pods as tar.

Restic has no direct support for accepting tar input or producing tar output, unless you are actually backing up tar archives.

I think they are referring to this feature:

It is also possible to dump the contents of a whole folder structure to stdout. To retain the information about the files and folders Restic will output the contents in the tar format

Which is documented here (but strangely not when you do a restic dump -h)

1 Like

Thanks for that info. Today I learned!