What is valid cron on GCP Cloud Scheduler? - google-cloud-platform

I have a Cloud Scheduler running on GCP and I would like to run with 2/5 * * * 1-5. This does not really work, it is instead just triggered once per hour, at 4 minutes past the hour for some reason. I know this is non-standard cron but at the same time neither the console or SDK complain about it.
I wonder what is valid cron for the Cloud Scheduler?
Is there any way to do what I wish, running it every five minutes after 2 past, i.e. HH:02, HH:07, HH:12 etc.?

In short; I simply messed up the cron timing. It works as it should with 2-59/5 * * * 1-5. This format follows the cron-standard.

Related

Aws Glue Workflow triggering multiple times one job (incorrect behavior)

I have a big glue workflow (about 100 jobs / crawlers), and it was executing properly until last week. Since then, my first conditional trigger (ALL), is executing 20 time the same job.
I've configured the job it self, to just allow 1 parallel execution, but every time the workflow executes, it tries to launch 20 times (the same job).
Also configured the workflow, to allow a max concurrency of 1, but that doesn't fix the problem.
Since i started working with glue workflow, i've noticed that the tool it self is buggy, old and maybe deprecated ?
Any tips on how to fix this problem ?
I too have faced similar problems. Even one is fixed, some other issue would occur lately. So my suggestion is to try using step functions.

Shutdown an ec2 instance after finishing computing

I’m coding a chess engine for a project at school and i need more computing power than my pc can offer.
So i turned to AWS and especially EC2. I want to test different algorithms.
I know how to start the instance and how to begin the computing on the instance but as soon as the computing is finished, I would like to send automatically the data files on s3 (i know the command but not how to automatically execute it) and shutdown the instance to avoid paying for nothing.
Thank you for your help,
You mention your script is in python, in that case probably you could execute it with AWS Lambda and configure rules in CloudWatch Events Rules to define the time to run the script. Consider the maximum time that Lambda allows is 15 minutes so if it is not suitable for your case you can check ECS Fargate Scheduled Tasks to run the process at the defined time and then delete the container.
As pointed out by samtoddler on Jan 11, 2021 :
a call to os.shutdown() after the computing provided what I wanted !
Thank you

Do I need "RunAndBlock" for scheduled web jobs?

My intention is to run a 3 second web job every 5 min. What happens if I skip the host.RunAndBlock?
If you just want a simple time scheduled job, there is no need to use the WebJobs SDK at all, so there is no host at all. Just use a plain console app (can be as simple as a one line Main), and deploy it as a scheduled CRON WebJobs. See https://learn.microsoft.com/en-us/azure/app-service/web-sites-create-web-jobs.

WebJob Runs Twice per each cron Schedule

I have a WebJob with the following cron
{"schedule": "0 0 * * * *"}
My logging and the logs from Kudu {site...}/azurejobs/#/jobs/triggered/{jobName} shows 2 successive entries running every hour within a minute of each other. The App Service plan is set to single instance.
How can I determine why I get 2 executions per scheduled event?
The only thing I can think of is that if you set up the Azure Scheduler in addition to the Kudu CRON file, they will each fire and cause a double invocation.
Any chance that you set up a schedule using VS? That would set up the Azure Scheduler. If so, you can delete the unwanted scheduler Job Collection.
Also, using Kudu Console, go under D:\home\data\jobs\triggered{jobname} and look at job_scheduler.log. That should only account for the Kudu cron scheduler.

Trigger an URL at a specific time (AWS)

Any ideas on how to reliably trigger an URL (web service) at a specific time? With the precision in seconds? For example, the script will be set so that it will be able to trigger a web service at 2015-05-27 12:34:55. In my scenario, the user will be able to select at what time, down to seconds a trade should execute. The web service must be then triggered at a specific time
AWS Lambda is not able to run at specific times.
Cron jobs won't work as it does not run every second
An SQS might work but coding it up to be reliable could be hard.
Thanks!
"at" command does what you need: https://calomel.org/cron_at.html
An addtitional tool one can use is called "at" and is used to execute a job only once. "at" is very useful, for example if you want run a backup job starting at 8pm and you expect to be leaving at 5:30pm.