I want to run a Job that, if it is the first time running the Job this week, it will go trough an extra step. I found that I can do this evalution with Simple Evaluation but I can't find how to make this 'once a week'check.
Anyone have any idea how can I make this?
do this
create new transformation, use get System info step and in type, select "first day of this week", check your date with this column and if equal, run your main using job executor else run the other one.
Related
I have jobs that need to be scheduled on the second to last Monday of a month. Is this possible with current functionality?
From what I've seen, it doesn't seem to be possible with standard cron expressions.
Currently I have the job running every week and a check inside the job to see if it is the correct week, but I'd rather not use this set up as it still registers the job as running and being successful.
Thanks!
I was able to answer my question. I made a small addition to the cron expressions file in the apscheduler module and added a class that allowed for [-1, -2, etc]. Then was able to use that as an index for a calendar from the calendar module to grab the week I wanted. So now it allows for expressions like '-2 thu'.
If someone wants more help with how I implemented this, let me know.
I am looking to see if its possible to have one job that runs different schedules, with the catch being one of the schedules needs to pass in a parameter.
I have an executable that will run some functionality when there is no parameter, but if there is a parameter present it will run some additional logic.
Setting up my job I created a schedule (every 15 minutes), Operating system (CmdExec)
runApplication.exe
For the other schedule I would like it to be once per day however the executable would need to be: runApplication.exe "1"
I dont think I can create a different step with a separate schedule, or can I?
Anyone have any ideas on how to achieve this without having two separate jobs?
There's no need for 2 jobs. What you can do is update your script so the result of your job (your parameter) is stored in a table. Then update your secondary logic to reference that table. If there's a value of parameter, then run your secondary logic. All in one script. If there's no value in that parameter, then have your secondary logic to return a 0 or not run at all.
Just make sure you either truncate the entire reference parameter table every run or you store a date in there so you know which one to reference.
Good luck.
I have a pentaho job that is scheduled to run every week and gets data from one table and populates in another.
Now the job executes every week irrespective of whether the source table was updated or not.
I want to put a condition before the job runs to see if the source was updated last week or not and run the job only if the source was updated else dont run the job.
There are many ways you can do this. Assuming you have a table in your database that stores the last date your job was run, you could do something like this.
Create a Job and configure a parameter in it (I called mine RunJob). Create a transformation which gets your max run date, or row count then looks up the run date or row count from the previous run and compares them. It then sets the value of your job's variable based on the results of the comparison. Mine looks like this.
Note that the last step in the transform is a Set Variables step from the Job branch.
Then in your job use a Simple Evaluation step to test the variable. Mine looks like this:
Note here that my transform sets the value of the variable only if the job needs to be run, otherwise it will be NULL.
Note also to be sure to update your last run date or row count after doing the table load. That's what the SQL step does at the end of the job.
You could probably handle this with fewer steps if you used some JavaScript in there, but I prefer not to script if I can avoid it.
I would like to be able to copy the total "Time Spent" from a Task on the Time sheet to the Task "Actual" field. This way I can use the Time Sheet to enter the time I've spent on a task and see the value (in the form of the "Actual" column) on the Team Status page. Suggestions the best way to tackle this? I'm new to the Rally APIs so not sure where to start.
The Time Spent field only exists on the Task Detail Page. It is not actually stored in the on the object and thus not returned in the WSAPI. If you wanted to update the Actual value for a task you would have to sum up the hours field on the TimeEntryValue.
My recommendation would be to use a fetch that looks something like
fetch="Hours,TimeEntryItem,Task"
That would give you everything you need in one query.
How do I run a job in Sql Server Agent in (SQL Server Management Studio) for 'x' number of days in a month?
eg: Every 1st.2nd and 3rd of every month
The problem is I am not sure of these days! The user will specify the 'x' number of days!
For instance, the user feels for the month of April he wants the job to be scheduled on 'x' days. Here x= 1st,2nd and 4th of April.
And for the month May he feels to schedule on 'x' days. Here x= 7th,8th and 10th!
Is it possible to schedule in such a way?
Is there any script to schedule this???
Make a schedule that's run on those three days. Assign this job to that schedule.
(To elaborate and make it perfectly clear).
Make three schedules (Rightclick Jobs, Manage Schedules).In new schedules choose - Recurring on monthly. One starts the 1st, one starts the 2nd, one starts the 3rd of every month (for example, or x times for whatever day of month you wish).
Name these schedules something that's easy for you to spot in a list.
On the job you wish to run on these days, properties on it, schedule, then pick the schedule(s) you want to assign to the given job.
That should be all.
If the schedule is user defined then I'd probably just schedule the job to run every day and have the first step be to check whether it should be running today and if not exit.
Check Howto Schedule a Job and follow the Instructions of cairnz.