Page History
...
- The script is available for Linux and MacOS® using bash shellsshell.
- The script terminates with exit code 0 to signal successful cancellation, with exit code 1 for command line argument errors and with exit code 4 for non-recoverable errors. Exit code 3 signals that no matching orders have been found.
- The script is intended as a baseline example for customization by JS7 users and by SOS within the scope of professional services.
...
-h | --help
- Displays usage.
-p | --password
- Asks the user for interactive keyboard input of the password used for the account specified with the
--user
option.. - The switch is used for secure interactive input as an alternative to use of the option
--password=<password>
.
- Asks the user for interactive keyboard input of the password used for the account specified with the
-r | --recursive
- Specifies that folders should will be looked up recursively if the
--folders
option is used.
- Specifies that folders should will be looked up recursively if the
-k | --kill
- Specifies that tasks of running orders should will be killed.
- If used without the
--sigterm
switch then orders are immediately killed using a SIGKILL signal corresponding to the command:kill -9
.
-t | --sigterm
- Specifies that a SIGTERM signal will be sent to tasks of running orders if the
--kill
switch is used. - The switch allows shell jobs that implement traps to perform some clean-up and to gracefully terminate before being killed by a SIGKILL signal.
- Specifies that a SIGTERM signal will be sent to tasks of running orders if the
-v | --verbose
- Displays verbose log output.
--show-logs
- Displays the log output created by the script if the
--log-dir
option is used.
- Displays the log output created by the script if the
--make-dirs
- If directories are missing that are indicated with the
--log-dir
option then they will be created.
- If directories are missing that are indicated with the
Exit Codes
0:
cancellation of orders have been successfully cancelledinitiated1
: argument errors3
: no orders found4
: is returned if the JS7 REST Web Service is not reachable or reports errors
...
Code Block | ||||
---|---|---|---|---|
| ||||
./cancel-orders.sh \ --url=http://joc-2-0-primary:7446 \ --user=root \ --password=root \ --controller-id=controller \ --date-to="$(date +'%Y-%m-%d')T00:00:00" # cancels all orders scheduled for a date before begin of the current day # limits cancellation to orders in the SCHEDULED state (default) # implies that the system time zone is used (default) |
Cancel failed and suspended orders to a Daily Plan date two days ago
Code Block | ||||
---|---|---|---|---|
| ||||
./cancel-orders.sh \ --url=https://joc-2-0-primary:7443 \ --cacert=/home/sos/jstest/certs/root-ca.pem \ --user=root \ -p \ --controller-id=controller \ --date-to="$(TZ=Europe/London date --date="1 day ago" +'%Y-%m-%d')T00:00:00" \ --time-zone=Europe/London \ --states=FAILED,SUSPENDED # cancels all orders scheduled for a date before yesterday # establishes the connection to JOC Cockpit by HTTPS and the Root CA Certificate is specified from the path to a .pem file # asks the user for interactive keyboard input of the password used for the account specified # specifies the date from an individual time zone # limits cancellation to orders in the FAILED orand SUSPENDED state |
Cancel late orders from a list of folders
Code Block | ||||
---|---|---|---|---|
| ||||
./cancel-orders.sh \ --url=http://joc-2-0-primary:7446 \ --user=root \ --password=root \ --controller-id=controller \ --date-to="$(date +'%Y-%m-%d')T00:00:00" \ --folders=/ProductDemo/CyclicExecution,/ProductDemo/ScheduledExecution \ --recursive # cancels late orders scheduled for yesterday's Daily Plan date # limits cancellation to orders scheduled in the SCHEDULED state (default) for workflows from the given folders # looks up sub-folders recursively |
...
Code Block | ||||
---|---|---|---|---|
| ||||
./cancel-orders.sh \ --url=http://joc-2-0-primary:7446 \ --user=root \ --password=root \ --controller-id=controller \ --date-to="$(date +'%Y-%m-%d')T00:00:00" \ --workflows=/ProductDemo/CyclicExecution/Cyclic-Check,/ProductDemo/ScheduledExecution/Daily-EOD # cancels late orders scheduled for yesterday's Daily Plan date # limits cancellation to orders scheduled in the SCHEDULED state (default) for the given list of workflows |
Overview
Content Tools