If you want to retrieve any kind of file, such as logs generated by an errand, from a bosh-controlled VM, you can make use of the built-in command bosh logs.
Tanzu Platform for Cloud Foundry
Write (or move) the files you want to retrieve under /var/vcap/sys/log. Add files to that top level directory, or create a subdirectory under "log" in which to add files.
When you create and download the log bundle with this command
bosh -d <deployment> logs vm-name
... the file(s) will be included in the compressed tar file, which is written to a directory on the system where the bosh logs command was executed.
sudo chmod a+r /var/vcap/sys/log/addedfiles
bosh -d <deployment> ssh vm-name -c "sudo rm -rf /var/vcap/sys/log/addedfiles"
Please check this KB if you want to collect additional logs for OpsManager, Bosh director and Bosh VM managed https://knowledge.broadcom.com/external/article?legacyId=91889