I have a C++ program that takes hours to run, and I would like to run it in the Cloud.
I've tried running it in Google Cloud Shell, but when the connection is lost, the execution is stopped. I tried using "nohup ./exefilename &"
but it didn't work.
I'm sure there should be a cheap and easy way to solve this. Many thanks in advance!
Cloud shell is designed to interact and manage your GCP resources, not to run programs itself, although you can run some small ones.
Your best option is to run your program in an instance, you can create one following this guide.
You can take a look at Cloud shell usage limits here, in addition to those limitations inactive sessions are stopped after 20 minutes.
Note that Cloud shell are just an instance that is running while you use them, once they stop the VM stops too, that's probably why nohup
didn't work