0

I have a bash script file where each line is a curl command to download a file. This bash file is in a Google bucket.

I would like to execute the file either directly from the storage and copy its downloaded contents there or execute it locally and directly copy its content to the bucket.

Basically, I do not want to have these fils on my local machine.. I have tried things along these lines but it either failed or simply downloaded everything locally.

gsutil cp gs://bucket/my_file.sh - | bash gs://bucket/folder_to_copy_to/

Thank you!

Tom
  • 275
  • 2
  • 16

1 Answers1

1

To do so, the bucket needs to be mounted on the pod (the pod would see it as a directory).

If the bucket supports NFS, you would be able to mount it as shown here. Also, there is another way as shown in this question.

otherwise, you would need to copy the script to the pod, run it, then upload the generated files to the bucket, and lastly clean everything up.

The better option is to use a filestore which can be easily mounted using CSI drivers as mentioned here.

akathimi
  • 1,393
  • 11