How to run function in cloudscript playfab using schedule tasks every 10 hours? - playfab

How to run function in cloudscript playfab using schedule tasks every 10 hours?
Currently I attempted the following cron-setup:
0 */10 * * *
However, the scheduling is not every 10 hours but the next schedule goes like this:
2022-07-18 20:00:00
2022-07-19 00:00:00
2022-07-19 10:00:00
2022-07-19 20:00:00
2022-07-20 00:00:00
...
while what I want is the result of the scheduling as follows:
2022-07-18 20:00:00
2022-07-19 06:00:00
2022-07-19 16:00:00
2022-07-20 02:00:00
2022-07-20 12:00:00
...
Any help would be greatly apricated!

Related

Can we trigger snowflake task manually or enable to run at a specific day and time

Can we trigger snowflake task manually or enable to run at a specific day and time?
if the above is not feasible. Any other alternative ideas?
When using USING CRON the following format is accepted:
# __________ minute (0-59)
# | ________ hour (0-23)
# | | ______ day of month (1-31, or L)
# | | | ____ month (1-12, JAN-DEC)
# | | | | _ day of week (0-6, SUN-SAT, or L)
# | | | | |
# | | | | |
* * * * *
There is no year option, so something like this would work:
'USING CRON 0 9-17 * * SUN America/Los_Angeles'
every hour starting at 9 AM and ending at 5 PM on Sundays (America/Los_Angeles time zone)
Yes, it is possible to run task manually using
EXECUTE TASK
Manually triggers an asynchronous single run of a scheduled task (either a standalone task or the root task in a task tree) independent of the schedule defined for the task.
A successful run of a root task triggers a cascading run of child tasks in the tree as their precedent task completes, as though the root task had run on its defined schedule.
EXECUTE TASK <task_name>;

Extract a value from a ScheduledTask array in Powershell

everyone. I am newbie to Powershell. So your help is much appreciated.
My question is the following. I have a powershell small script that provides me with server Start, Stop, Kill ... tasks.
Here's the command
PS P:\> Get-ScheduledTask -TaskPath "*$someString*" | Get-ScheduledTaskInfo | Select TaskName,LastRunTime,NextRunTime
TaskName LastRunTime NextRunTime
-------- ----------- -----------
Archive 10/14/2017 7:00:00 AM 10/21/2017 7:00:00 AM
Kill 10/15/2017 12:50:50 PM 10/22/2017 12:50:50 PM
Restart 10/20/2017 12:00:00 AM 10/23/2017 12:00:00 AM
Start 10/15/2017 1:00:00 PM 10/22/2017 1:00:00 PM
Stop 10/13/2017 5:30:30 PM 10/20/2017 5:30:30 PM
I would like to extract the value of LastRunTime that corresponds to Start and the value of NextRunTime that corresponds to stop, and have them converted to a String.
Thank you.
Not very useful in the requested OP format, but here you go
C:\> $TaskNames = "Start","Stop"
C:\> $data = Get-ScheduledTask -TaskName $TaskNames | Get-ScheduledTaskInfo
C:\> [string]"$(($data | sort)[0].LastRunTime) $(($data | sort)[1].NextRunTime)"
10/20/2017 08:15:15 10/21/2017 09:16:16
this will only work right if your task names are actually in alphabetical order. Change the indexes (numbers in []) if the sort comes out in a different order.

How to view Query jobs submitted via GAE in BigQuery console

I have a cron job in GAE. This cron job will create a BigQuery Job and submit it.
When I login into BigQuery console, I don't see this Job. I see only the Job created from BigQuery console not the jobs created via this CRON job.
I want to see whether the job is completed successfully or not. How can see the jobs created via GAE in BigQuery console?
I am using Python in GAE and here is the code snippet of it
job = bigquery_client.run_async_query(job_name, query)
# We are using Standard SQL
job.use_legacy_sql = False
# Start BigQuery job
job.begin()
use the cli tool to obtain the most recent jobs:
bq ls -j -a --max_results=15
running this would display a table with job ids and the respective timing.
jobId Job Type State Start Time Duration
--------------------------------- ---------- --------- ----------------- ----------
bquijob_1864e679_15a84d8878a query SUCCESS 28 Feb 07:11:06 0:00:04
bquijob_770b512_15a84d8122c query FAILURE 28 Feb 07:10:35 0:00:00
bquijob_de0df03_15a84d6a4fa query FAILURE 28 Feb 07:09:02 0:00:00
bquijob_52c4f7d7_15a84d660e6 query FAILURE 28 Feb 07:08:44 0:00:00
bquijob_76a2c1be_15a84d5e769 query FAILURE 28 Feb 07:08:13 0:00:00
bquijob_7f51dde5_15a84d55afb query SUCCESS 28 Feb 07:07:41 0:00:08
bquijob_34f25864_15a84d50503 query SUCCESS 28 Feb 07:07:18 0:00:08
job_Ca0cuRTAjY7MEHAs7vTJMxtVYTs query SUCCESS 28 Feb 07:00:47 0:00:09
job_hHfmcdwyBsPsYF5dDvvOdR1Rmd0 load SUCCESS 28 Feb 07:00:26 0:00:20
job_mkiLf_mFHLKSplGJOtg-XDKzvv4 load SUCCESS 28 Feb 02:52:50 0:00:02
job_3RsPvttxWwv3SzVoOI9Cv_2yWtA query SUCCESS 27 Feb 21:18:40 0:00:08
job_JLsqJO0NEIlKNac6jkDWbwneGMg extract SUCCESS 27 Feb 11:35:04 0:00:17
job_KOS7vKX4aX0FNbK6dibE7cxzcQA query SUCCESS 27 Feb 11:33:44 0:00:37
bquijob_44046bec_15a802f703a query SUCCESS 27 Feb 09:27:48 0:00:07
job_2qQ6YSWeXaP2y2doONQJsIoga3c query SUCCESS 27 Feb 08:53:20 0:00:06
Second option is to enable audit logs, and locate the queries under the tables that are automatically created in one of the BigQuery datasets
https://cloud.google.com/bigquery/audit-logs

how to run on an imported table and pass each row as a parameter to a query(SQL server)

I have a CSV file that I load into my DB( Without using SSIS) with about 20 rows and 3 columns(as below):
**start_date_local** **end_date_local** **provider_unit**
18/04/2017 16:00 19/04/2017 16:00 501638-52973
19/04/2017 05:30 19/04/2017 23:00 501613-52345
07/04/2017 14:30 08/04/2017 15:30 201447-20266
each row/record should act as a parameter in my query (SQL server) that consist the following 'Where' clause
((Transmission.Transmission_StartDateAccurate >= '**start_date_local**')
AND (Transmission.Transmission_EndDateAccurate <= **'end_date_local'**))
AND Units.sn LIKE **'provider_unit'**
i would like to receive at my result set usage data (Which is in another table and that's fine) of each unit at its specific times - as follows:
start_date_local end_date_local provider_unit GB USAGE
18/04/2017 16:00 19/04/2017 16:00 501638-52973 35.3
19/04/2017 05:30 19/04/2017 23:00 501613-52345 42.4
07/04/2017 14:30 08/04/2017 15:30 201447-20266 4.5
please advice:)
Thanks,
Guy
If you are loading this data into a Staging table within your database, you can just join onto it to use the data in a set based manner, which will return your dataset for all instances.
Not having your full schema this is a bit of guess work, but you should be doing something like this:
select s.start_date_local
,s.end_date_local
,s.provider_unit
,t.GBUsage
from Transmission t
join StagingTable s
on(t.Transmission_StartDateAccurate >= s.start_date_local
and t.Transmission_EndDateAccurate <= s.end_date_local
)
join Units u
on(u.sn like s.provider_unit);

How to get proper hour from $filter in angular?

I have input:
Tue Apr 15 2014 18:00:28 GMT+0300 (IDT)
When I try to run filter:
var currDate = $filter('date')(new Date(date), 'dd-MM-yyyy h:mm');
I get:
"15-04-2014 6:00"
In input hour is 18 but I get 6
Here is a Demo that demonstrates the problem.
Thanks,
You need to tell it to use the 24 hour clock, so instead of h use HH. Documented here

Resources