Difference between revisions of "Documentation/Scheduling/Timed Scheduled Scripts"

From ScriptRunner
Jump to: navigation, search
m
Line 5: Line 5:
 
ScriptRunner provides the ability to schedule scripts to run at specific times. This is not intended to provide a replacement for tools such as cron, but can be useful when you want to capture the output of the script within ScriptRunner, or have ScriptRunner alert when the job fails. This can be extended further with [[ Documentation/Scheduling/Batch Schedules and Jobs | Batch Schedules ]] that allow scripts dynamically chained together.
 
ScriptRunner provides the ability to schedule scripts to run at specific times. This is not intended to provide a replacement for tools such as cron, but can be useful when you want to capture the output of the script within ScriptRunner, or have ScriptRunner alert when the job fails. This can be extended further with [[ Documentation/Scheduling/Batch Schedules and Jobs | Batch Schedules ]] that allow scripts dynamically chained together.
  
'''Creating A Scheduled Script'''
+
'''Creating A Time Scheduled Script'''
  
 
* From the menu, select Schedules > Time Scheduled Scripts.
 
* From the menu, select Schedules > Time Scheduled Scripts.
Line 14: Line 14:
 
** '''Description''': A descriptive name that will be used to reference the job in other areas of ScriptRunner, including alerts.
 
** '''Description''': A descriptive name that will be used to reference the job in other areas of ScriptRunner, including alerts.
 
** '''Script''': Select the script you wish to schedule. Only scripts applicable to your user group will be shown.
 
** '''Script''': Select the script you wish to schedule. Only scripts applicable to your user group will be shown.
** '''Start Time / End Time''': (Optional) These define the time period in which the schedule will be triggered. Outside of the time window defined by these, the Time Scheduled Script will be not started. This can be useful for when wanting to schedule scripts to run only for a limited period of time, and then automatically stop.
+
** '''Start Time / End Time''': (Optional) These define the time period in which the schedule will be triggered. Outside of the time window defined by these, the Time Scheduled Script will be not started. This can be useful for when wanting to schedule scripts to run only for a limited period of time, and then automatically stop.<br />If the script is set to run on an agent, ScriptRunner will automatically set this host as the agent.
** '''Script Host''': Select the host the scheduled script should trigger on. See the Selecting a Script Host section below regarding some considerations that need to be given here.
+
** '''Script Host''': (Optional) To override the host the script triggers on, select a Script Host here. If the script itself is set to run on a SSH host, then this host will need to have SSH access to that host for the scheduled to work. SSH hosts themselves can not be selected.
 
** '''Run Time''': The time the script should trigger in format HH:MM.
 
** '''Run Time''': The time the script should trigger in format HH:MM.
 
** '''Day Of Week''': Select the day of week the script should trigger on.
 
** '''Day Of Week''': Select the day of week the script should trigger on.
Line 25: Line 25:
 
* The Time Scheduled Script should now be saved and picked up to run a the given schedule.
 
* The Time Scheduled Script should now be saved and picked up to run a the given schedule.
  
 +
  
'''Selecting A Script Host'''
+
 +
'''Editing Time Scheduled Scripts'''
  
As scripts can be set to run on specific hosts, setting the Script Host value on a Time Scheduled Script doesn't mean it will run on that host, only that it will be triggered on that host.
+
* From the menu, select Schedules > Time Scheduled Scripts.
 +
 
 +
* Click [[File:editButton.png]] against the Time Scheduled Script you wish to update. Use [[ File: previous.png ]] and [[ File: next.png ]] to scroll through pages of Time Scheduled Scripts if needed.
 +
 
 +
* The Edit Time Scheduled Script window should now be shown with details of the selected Time Scheduled Script.<br />[[File: editTimeScheduledScript.png]]
 +
** '''Script''': Select the script you wish to schedule. Only scripts applicable to your user group will be shown.
 +
** '''Start Time / End Time''': (Optional) These define the time period in which the schedule will be triggered. Outside of the time window defined by these, the Time Scheduled Script will be not started. This can be useful for when wanting to schedule scripts to run only for a limited period of time, and then automatically stop.<br />If the script is set to run on an agent, ScriptRunner will automatically set this host as the agent.
 +
** '''Script Host''': (Optional) To override the host the script triggers on, select a Script Host here. If the script itself is set to run on a SSH host, then this host will need to have SSH access to that host for the scheduled to work. SSH hosts themselves can not be selected.
 +
** '''Run Time''': The time the script should trigger in format HH:MM.
 +
** '''Day Of Week''': Select the day of week the script should trigger on.
 +
** '''Day Of Month''': Enter the day of the month the script should trigger on, or 0 for every day.
 +
** '''Enabled''': Tick this to allow the Time Scheduled Script to trigger and planned, or untick to prevent it running.
 +
 
 +
* Click [[File:saveButton.png|100px]].
 +
 
 +
* Changes to the Time Scheduled Script will now be saved. Any changes will take affect immediately.
 +
 
 +
 +
 
 +
 +
'''Removing A Time Scheduled Script'''
 +
 
 +
* From the menu, select Schedules > Time Scheduled Scripts.
 +
 
 +
* Click [[File:removeButton.png]] against the Time Scheduled Script you wish to remove. Use [[ File: previous.png ]] and [[ File: next.png ]] to scroll through pages of groups if needed.
 +
 
 +
* Click [[File:removeConfirmButton.png|100px]] on the confirmation prompt.<br /><br />[[File: removeTimeScheduledScript.png]].
 +
 
 +
* The selected Timed Schedueld Script will now be removed.

Revision as of 00:44, 4 October 2020


Documentation :: Scheduling :: Time Scheduled Scripts

ScriptRunner provides the ability to schedule scripts to run at specific times. This is not intended to provide a replacement for tools such as cron, but can be useful when you want to capture the output of the script within ScriptRunner, or have ScriptRunner alert when the job fails. This can be extended further with Batch Schedules that allow scripts dynamically chained together.

Creating A Time Scheduled Script

  • From the menu, select Schedules > Time Scheduled Scripts.
  • Click NewButton.png.
  • The Create Time Scheduled Script window should now be shown.
    CreateTimeScheduledScript.png
    • Description: A descriptive name that will be used to reference the job in other areas of ScriptRunner, including alerts.
    • Script: Select the script you wish to schedule. Only scripts applicable to your user group will be shown.
    • Start Time / End Time: (Optional) These define the time period in which the schedule will be triggered. Outside of the time window defined by these, the Time Scheduled Script will be not started. This can be useful for when wanting to schedule scripts to run only for a limited period of time, and then automatically stop.
      If the script is set to run on an agent, ScriptRunner will automatically set this host as the agent.
    • Script Host: (Optional) To override the host the script triggers on, select a Script Host here. If the script itself is set to run on a SSH host, then this host will need to have SSH access to that host for the scheduled to work. SSH hosts themselves can not be selected.
    • Run Time: The time the script should trigger in format HH:MM.
    • Day Of Week: Select the day of week the script should trigger on.
    • Day Of Month: Enter the day of the month the script should trigger on, or 0 for every day.
    • Enabled: Tick this to allow the Time Scheduled Script to trigger and planned, or untick to prevent it running.
  • Click SaveButton.png.
  • The Time Scheduled Script should now be saved and picked up to run a the given schedule.



Editing Time Scheduled Scripts

  • From the menu, select Schedules > Time Scheduled Scripts.
  • Click EditButton.png against the Time Scheduled Script you wish to update. Use Previous.png and Next.png to scroll through pages of Time Scheduled Scripts if needed.
  • The Edit Time Scheduled Script window should now be shown with details of the selected Time Scheduled Script.
    EditTimeScheduledScript.png
    • Script: Select the script you wish to schedule. Only scripts applicable to your user group will be shown.
    • Start Time / End Time: (Optional) These define the time period in which the schedule will be triggered. Outside of the time window defined by these, the Time Scheduled Script will be not started. This can be useful for when wanting to schedule scripts to run only for a limited period of time, and then automatically stop.
      If the script is set to run on an agent, ScriptRunner will automatically set this host as the agent.
    • Script Host: (Optional) To override the host the script triggers on, select a Script Host here. If the script itself is set to run on a SSH host, then this host will need to have SSH access to that host for the scheduled to work. SSH hosts themselves can not be selected.
    • Run Time: The time the script should trigger in format HH:MM.
    • Day Of Week: Select the day of week the script should trigger on.
    • Day Of Month: Enter the day of the month the script should trigger on, or 0 for every day.
    • Enabled: Tick this to allow the Time Scheduled Script to trigger and planned, or untick to prevent it running.
  • Click SaveButton.png.
  • Changes to the Time Scheduled Script will now be saved. Any changes will take affect immediately.



Removing A Time Scheduled Script

  • From the menu, select Schedules > Time Scheduled Scripts.
  • Click RemoveButton.png against the Time Scheduled Script you wish to remove. Use Previous.png and Next.png to scroll through pages of groups if needed.
  • Click RemoveConfirmButton.png on the confirmation prompt.

    RemoveTimeScheduledScript.png.
  • The selected Timed Schedueld Script will now be removed.