The try-later Script

Valid for versions 82 through the latest version

Version:

82


Last modified: May 13, 2020

Overview

The /usr/local/cpanel/scripts/try-later script runs a check command at a specified interval. If the check command returns an error, the script will retry that check command a specified number of times. When the check command succeeds, the script will run the action command. If the check command fails the maximum number of retries, the script will perform an act-finally command.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/scripts/enable_spf_dkim_globally -x -/usr/local/cpanel/scripts/try-later --action COMMAND --max-retries NUMBEROFMINUTES --delay NUMBEROFMINUTES --check COMMAND  -at --act-finally COMMAND-user=user1 --user=user2

Options

Use the following options with this script:

Options Description Example
--check COMMAND The script runs this command to determine whether to perform the action command. /usr/local/cpanel/scripts/try-later --check COMMAND
--at The script will run the check command at the specified time. For more information, read the at manual page. /usr/local/cpanel/scripts/try-later --at 1620 apr 20
--delay The script will pause for this number of minutes before it performs each check and action command.
Note:
This option overrides the --at option.
/usr/local/cpanel/scripts/try-later --delay 5
--max-retries The script will attempt to run the check command this number of times. /usr/local/cpanel/scripts/try-later --max-retries 3
--skip-check The script will skip the first check command. /usr/local/cpanel/scripts/try-later --skip-check
--action COMMAND When the check command succeeds, the script will run the action command. /usr/local/cpanel/scripts/try-later --action COMMAND
--act-finally COMMAND If the check command fails the maximum number of retries, the script performs this command. /usr/local/cpanel/scripts/try-later --act-finally COMMAND
--has-jobs The script will indicate whether its queue is empty or not. /usr/local/cpanel/scripts/try-later --has-jobs

Additional Documentation