--stdin-file usage

Hi there,

I am trying to use kopia stdin-file feature.

There is somefolder that some.file is getting copied to and meanwhile I tried to use the following command:

kopia snapshot create --stdin-file=/somefolder/some.file

Which received the following error message:
ERROR no snapshot sources.

Any help with correct way of going about his appreciated. I am sorry if I missed any written docs on this feature.

Many thanks Joel.

Hi Joel, --stdin-file is meant for cases where you’d pipe data to kopia directly. A classic use case would be tools that dump database contents: In such a case, the data you feed into kopia doesn’t have any source file name. Kopia however, needs a file name to represent the data in the repository. In such a case, it’s possible to provide a (fictional) file name through --stdin-file. This path/file doesn’t need to exist anywhere on the source filesystem, but it will exist in the snapshot (e.g., when you mount it) and contain the data which was piped into kopia.

Trying to snapshot a while that’s in the process of being written might prove tricky. If you must, I’d try to work off a consistent state such as a filesystem snapshot (e.g., through BTRFS of ZFS or a shadow copy on Windows).

For this command to work you’d indeed need to provide a source. In this case, - should do the trick, so the full command would be kopia snapshot create --stdin-file=/somefolder/some.file -.