Monday, 2 September 2024

AutoSys Scheduler: How to Update Jobs Using JIL

 



AutoSys Scheduler: How to Update Jobs Using JIL

Introduction to AutoSys and JIL

AutoSys is an automated job control system for scheduling, monitoring, and reporting on job executions across various platforms. It is widely used in enterprise environments to manage complex job workflows, ensuring that jobs run at the right time, in the right sequence, and under the right conditions.

Job Information Language (JIL) is a scripting language used in AutoSys to define job attributes. It allows users to create, modify, and manage jobs in AutoSys. A JIL file contains a set of job definitions that AutoSys can interpret and execute. Understanding how to update jobs using JIL is crucial for maintaining and optimizing job workflows.

Key Concepts in JIL

Before diving into updating jobs, it's essential to understand some of the key JIL components:

  • Job Definition: Describes the job's attributes such as its name, type, command to execute, schedule, etc.
  • Job Types: AutoSys supports various job types like CMD (command job), FW (file watcher job), and BOX (a container for grouping jobs).
  • Attributes: Properties that define how and when the job should execute, such as command, start_times, condition, run_calendar, etc.

Steps to Update a Job Using JIL

  1. Access the JIL Editor:

    • Open the command-line interface (CLI) where AutoSys is installed.
    • Type jil and press Enter to enter the JIL editor.
  2. List Existing Job Attributes (Optional):

    • Before making updates, you may want to view the current attributes of the job.
    • Use the autorep command to display the job’s existing configuration:
      bash:

      autorep -J <job_name>
  3. Create or Update the JIL File:

    • To update an existing job, you can either edit the job directly in the JIL editor or modify a pre-existing JIL file.
    • Example JIL syntax for updating a job:
      jil:

      update_job: <job_name> command: <new_command> start_times: <new_start_times> run_calendar: <new_calendar> condition: <new_condition>
    • Replace <job_name> with the actual job name, and update other attributes as necessary.
  4. Submit the Updated JIL:

    • After making changes, you can submit the JIL to AutoSys by either pasting the updated JIL code directly into the JIL editor or using a JIL file.
    • If using a file, save the updates in a .jil file and execute:
      bash:

      jil < my_updated_job.jil
  5. Verify the Update:

    • Once the JIL is submitted, verify that the job has been updated correctly using:
      bash:

      autorep -J <job_name>
    • Check that the job attributes reflect the updates made.
  6. Testing the Updated Job (Optional):

    • It’s good practice to test the job after updating it to ensure that it behaves as expected.
    • You can start the job manually using the sendevent command:
      bash:

      sendevent -E FORCE_STARTJOB -J <job_name>
    • Monitor the job’s execution using autorep to ensure it runs smoothly.

Common Scenarios for Updating Jobs

Here are some common scenarios where updating JIL might be necessary:

  • Changing the Command: If the script or executable that the job runs has been updated or moved, you’ll need to update the command attribute.
  • Modifying the Schedule: Changes in business requirements may necessitate updates to the job’s schedule, such as altering the start_times, run_calendar, or days_of_week.
  • Adjusting Dependencies: As workflows evolve, the job’s dependencies (condition) may need to be updated to reflect new or removed dependencies.
  • Updating Notifications: Adjusting the job’s notification settings to inform different users or systems of job status changes.

Best Practices for Updating JIL

  • Version Control: Keep a version history of JIL files to track changes and roll back if necessary.
  • Testing: Always test jobs after updating them to ensure they function as expected.
  • Documentation: Document any changes made to job definitions to maintain clarity in the job management process.

Conclusion

Updating jobs using JIL in AutoSys is a critical task that ensures jobs run according to updated requirements and business needs. By following the steps outlined above and adhering to best practices, you can effectively manage and optimize job workflows within your AutoSys environment.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.