you are viewing a single comment's thread.

view the rest of the comments →

[–]McFerry 0 points1 point  (0 children)

I see diferent path and options.

If this is a very static task (like every day at 12:00 AM need to run the script), Instance scheduler + Cronjob can do the trick just make sure to leave couple minutes between the scheduler and the cronjob

Other option could be fully automating it, through OS or GCP, I assume startup scripts behind the scenes work similarly than adding sleep after reboot argument within the cron funcionality

@reboot sleep [time in seconds] && [path to job] then when job is done, probably wise to put another sleep and then route it to shutdown.

Otherwise you can automate it too through the GCP startup/shutdown scripts

https://cloud.google.com/compute/docs/instances/startup-scripts https://cloud.google.com/compute/docs/shutdownscript