How to schedule a job every 10 mins using JIL script - autosys

How can I set a job in autosys which will run evening from 4pm to 5pm every 10 minutes?
Please help me how I can specify then start time parameter. I am new to this JIL script.
Also where can I get the complete details about scheduling a job using JIL script?

You can give the attribute start_mins for every 10 mins with the run_window. You can schedule jobs for every minute but you do not have it in seconds.
date_conditions: 1
days_of_week: all
start_mins: 00,10,20,30,40,50
run_window: "16:00-17:00"
timezone: india

/* ----------------- template ----------------- */
insert_job: template job_type: c
box_name: box1
command: <xxx>
machine: <hostname>
owner: <username>
permission: gx,ge
date_conditions: 1
days_of_week: all
start_mins: 0,30
run_window: "16:00-17:00
please refer to the cheatsheet for further details
http://supportconnectw.ca.com/public/autosys/infodocs/autosys_cheatsheet.asp

Use start_mins: "00,10,20,30,40,50"

Related

How to configure/run single autosys job on multiple unix servers simultaneously

I am working on shell script which will clean all the older logs and I would like to schedule this job autosys but since I have multiple servers where this job should run hence looking for the information that how to create a single JIL file to run the job on multiple boxes ?
Sample JIL:
insert_job: cleanup job_type: cmd
description: "This job will cleanup logs from server"
machine: <server_name>
owner: <user_name>
max_run_alarm: 0
alarm_if_fail: y
alarm_if_terminated: y
date_conditions: y
send_notification: n
days_of_week: we,sa
start_times: "00:00"
command: /test/autosys/cleanup.sh
std_out_file: >> /test/autosys/cleanup_`hostname`_`date+%Y%m%d`.out
std_err_file: >> /test/autosys/cleanup_`hostname`_`date+%Y%m%d`.err
In another question I read that we can't give multiple server name in machine tag by comma separated because job will run on either of the server. But I want job to be run to all the servers. How to achieve that ?
Achieving by a single job seems not in the scope of Autosys.
However, the most efficient way to achieve this would be implementing box job.
Step01: Create individual jobs for each host, Cleanup_on_HostA and Cleanup_on_HostB so on
Step02: Group the individual job into a box and schedule the box. This way all the jobs inside the box would start parallelly.
Sample JIL:
insert_job: Housekeeping_Box
job_type: box
date_conditions: y
days_of_week: we,sa
start_times: "00:00"
insert_job: Cleanup_on_HostA
job_type: cmd
box_name: Housekeeping_Box
description: "This job will cleanup logs from server"
machine: <hostA>
owner: <user_name>
max_run_alarm: 0
alarm_if_fail: y
alarm_if_terminated: y
command: /test/autosys/cleanup.sh
std_out_file: >> /test/autosys/cleanup_`hostname`_`date+%Y%m%d`.out
std_err_file: >> /test/autosys/cleanup_`hostname`_`date+%Y%m%d`.err
insert_job: Cleanup_on_HostB
job_type: cmd
box_name: Housekeeping_Box
description: "This job will cleanup logs from server"
machine: <hostB>
owner: <user_name>
max_run_alarm: 0
alarm_if_fail: y
alarm_if_terminated: y
command: /test/autosys/cleanup.sh
std_out_file: >> /test/autosys/cleanup_`hostname`_`date+%Y%m%d`.out
std_err_file: >> /test/autosys/cleanup_`hostname`_`date+%Y%m%d`.err

how oozie timezone work, it does not pick the right timezone?

I have oozie job running on CDH cluster. I have the following coordinator
<coordinator-app name="name" frequency="0 */5 * * *" start="2020-03-05T16:00Z" end="2020-03-07T16:00Z" timezone="America/New_York" xmlns="uri:oozie:coordinator:0.4">
I submitted this job at 15:15 new york time and oozie started the first job right away and it was marked at 15:00 (new york time) and the next one is scheduled for 19:00. I don't understand the time zone for oozie. Why it does not pick up the time zone I have specified ?
You can over-ride the Timezone when submitting the oozie job on the terminal
-timezone EST -config coordinator.properties -run

Airflow: Can't set 'default_timezone' to 'system'

Running puckel/docker-airflow, modified build so that both environment variables, and airflow.cfg have:
ENV AIRFLOW__CORE__DEFAULT_TIMEZONE=system
and
default_timezone = system
accordingly.
But in the UI, it still shows UTC, even though system time is EAT. Here is some evidence from the container:
airflow#906d2275235d:~$ echo $AIRFLOW__CORE__DEFAULT_TIMEZONE
system
airflow#906d2275235d:~$ cat airflow.cfg | grep default_timez
default_timezone = system
airflow#906d2275235d:~$ date
Thu 01 Aug 2019 04:54:23 PM EAT
Would appreciate any help, or an advice on your practice with this.
According to Airflow docs:
Please note that the Web UI currently only runs in UTC.
Although UI uses UTC, Airflow uses local time to launch DAGs. So if you have for example schedule_interval set to 0 3 * * *, Airflow will start the DAG at 3:00 EAT, but it in the UI you will see it as 0:00.

How to write a cron job for only 10 days?

I need to write a cron job that runs daily, but for only 10 days and stops after
executing for 10 days.
As soon as I write a job, it should start and run for 10 days daily.
Do: 0 10 5-15 1 * command
for more information on crontab visit
As soon as you finished with the script, save to particular path. After that set a cronjob for that job.
Eg:
filename : /home/script/Job1
set cron:
* 00 10-20 * * /home/script/Job1
If suppose you are writing you job on 10th, then another 10 days it will run as my crontab at 12.00 A.M.

How to schedule a process in a router

I am using the below code to execute a TCL script inside a cisco router.
Router#tclsh
Router(tcl)#source tftp://tftp-server/tcl-script.tcl
Everyday I wanted to execute same script in my router at 10 PM. how can I schedule it?
Regards,
Varghese
You need look at kron command. See Cisco command reference.
And write something like this:
configure terminal
kron policy-list policy-day10pm
cli tclsh tftp://tftp-server/tcl-script.tcl
exit
kron occurrence day10pm at 22:00 recurring
policy-list policy-day10pm
exit
exit
show kron schedule
>> policy-day10pm inactive, will run again in 0 days 08:05:41 at 22:00 on

Resources