In today's fast-paced IT landscape, automation is king. And that's where AutoSys shines, standing tall as a powerful workload automation (WLA) tool that orchestrates and executes your tasks like a digital maestro. But mastering its capabilities can seem daunting, especially for newcomers. This blog cuts through the complexity, offering a practical guide to creating, updating, and deleting jobs in AutoSys, empowering you to take control of your automation game.
What is AutoSys?
Think of AutoSys as your trusty IT conductor, meticulously scheduling and running tasks across your entire infrastructure. From routine backups to intricate data processing pipelines, AutoSys automates these critical processes, ensuring timely execution and error-free operation. Whether you're managing servers, applications, or data, AutoSys streamlines your workflows, boosts efficiency, and frees up your team for more strategic endeavors.
Creating Jobs in AutoSys:
Crafting jobs in AutoSys is surprisingly intuitive, thanks to the Job Information Language (JIL). Imagine JIL as your recipe book for automation, where you define the ingredients (scripts, commands, parameters) and instructions (scheduling, dependencies) for your desired outcome.
Here's the basic JIL recipe for creating a new job:
Start with the basics: Define the job name, type (command, script, box), and owner. "Backup_script" as your job name,
c
for a command type, and your username as the owner could be your starting point.Specify the action: Tell AutoSys what to do! Use the "command" attribute to reference the script or executable to be run. Remember,
backup.sh
could be your command in this case.Choose your platform: Determine where the job should run by specifying the machine name, like "backup_server."
Schedule your workflow: Define the job's execution frequency. For daily backups, use "days_of_week: all" and "start_times: 02:00."
Refine the details: Set additional attributes like error handling with "alarm_if_fail: 1" and output capture with "std_out_file: /logs/backup.log."
That's it! Save your JIL script and run it with the jil
command to see your automated job spring to life.
Updating and Deleting Jobs:
Your needs evolve, and so should your automation. AutoSys makes it easy to update and delete existing jobs. For updates, simply modify the relevant attributes in your JIL script and re-run it. To delete a job, use the delete_job: <job_name>
command in JIL. Remember, with great power comes great responsibility, so use the delete command cautiously!
Beyond the Basics:
This is just a taste of AutoSys's vast capabilities. From dependencies and conditions to file watchers and global variables, there's a treasure trove of features to explore. Don't hesitate to dive deeper into the JIL documentation and discover how AutoSys can truly transform your IT operations.
Sample Scripts:
Want to see these concepts in action? Here are some sample JIL scripts:
- Creating a simple command job:
/* ----------------- Job Name ----------------- */
insert_job: <job_name>
job_type: <job_type>
command: <command_to_execute>
machine: <machine_name>
owner: <job_owner>
permission: <permissions>
description: <job_description>
std_out_file: <standard_output_file>
std_err_file: <standard_error_file>
alarm_if_fail: <0_or_1>
/* ----------------- Additional Attributes ----------------- */
/* Add other attributes as needed, such as:
box_name, max_run_alarm, priority, days_of_week, start_times, condition...
Refer to your CA Workload Automation AE documentation for more details. */
Example:
/* ----------------- Daily Backup Job ----------------- */
insert_job: daily_backup
job_type: c
command: /usr/bin/backup.sh
machine: backup_server
owner: admin
permission: gx,wx
description: "Runs the daily backup script"
std_out_file: /logs/backup_out.log
std_err_file: /logs/backup_err.log
alarm_if_fail: 1
/* ----------------- Scheduling ----------------- */
days_of_week: all
start_times: "02:00"
/* ----------------- Dependencies ----------------- */
condition: s(database_backup)
/* ----------------- Other Attributes ----------------- */
max_run_alarm: 120
- Updating an existing job:
update_job: sample_job
command: /bin/echo "The job has been updated!"
- Deleting a job:
delete_job: sample_job
- Creating a file watcher job:
insert_job: <job_name>
job_type: c
command: <command_to_execute_when_file_arrives>
machine: <machine_name>
watch_file: <file_path_and_name>
max_run_alarm: <maximum_runtime_before_alarm>
alarm_if_fail: <0_or_1>
/* Additional attributes as needed */
Example:
insert_job: process_datafile
job_type: c
command: /apps/process_data.sh
machine: data_server
watch_file: /data/incoming/datafile_*.csv
max_run_alarm: 60
alarm_if_fail: 1
- Executing a JIL script from a file:
jil > script.jil
Executing Multiple Scripts:
Want to run multiple JIL scripts from one file? No problem! Use the include
statement:
include: "script1.jil"
include: "script2.jil"
Remember, order matters, and errors in included scripts can stop execution.