How to remove tmp files uploaded by dvc add --out

Hi,

First of all, I love “dvc”! It is so useful for my project!
Thank you very much for providing it to me. :smile:

I have some questions about temporary files created by “dvc add --out” command. It would be appreciated if you help me.

I run the following command to add /outside/project/directory/data.

$ dvc add --out mydata /outside/project/directory/data

This command seems to upload files in /outside/project/directory/data to dvc cache directory like this. (here, /my/dvc_cache/ is my dvc cache directory)

/my/dvc_cache/files/md5/.XIt3dn31aCwR83UzvYTYiQ.tmp
/my/dvc_cache/files/md5/.mJmybe_ATBDMHb51Gt-51w.tmp
/my/dvc_cache/files/md5/.oRPlNy5uS-vKYXyAiXl6TQ.tmp
/my/dvc_cache/files/md5/.zbcU6YNlS4piRJMv-EmE4w.tmp

Here are my questions :

  • Is there any way to clean up these files automatically when “dvc add” is completed?
  • Or is there any way to clean up these files safely? Can “dvc gc” command be used for this purpose?

Please let me know.
Thank you very much for your cooperation in advance.

Best Regards,
Kaz DEGUCHI

dvc is supposed to clean that up when the operation is completed. I see that it’s a bug in add --out here:

I’ll try to fix it soon. (I’d encourage you to open an issue in Create new issue - iterative/dvc though).

It’s safe to remove those files. Unfortunately, dvc gc command does not clean those up.

I’ve just create an issue about this:

Thank you very much for your help in advance.

Best Regards,
Kaz DEGUCHI

1 Like