SchedulerX allows you to execute specific scripts on self-managed hosts or Elastic Compute Service (ECS) instances. This topic describes how to deploy an agent on a host, associate the host with a SchedulerX application, and create a Cron job in the SchedulerX console to execute Shell scripts on the host based on specified rules.
Prerequisites
An ECS instance or a host is available. For more information, see Get started with ECS.
The Java Development Kit (JDK) environment is installed on the ECS instance or host. The JDK environment is required for starting the agent.
SchedulerX is activated. For more information, see Activate SchedulerX.
Make sure that the server and the SchedulerX service are in the same region.
Background information
In this example, an agent is used to associate the host with SchedulerX and create a Cron job in the SchedulerX console to execute Shell scripts. You can also use one of the following methods to connect to SchedulerX:
Overview
You can use an agent to quickly connect to SchedulerX and schedule jobs. The procedure includes four steps:
Associate your host with SchedulerX: Create an application in the SchedulerX console and associate the host with the application.
Create a job for the host: Create a job in the SchedulerX console and make sure that the job is associated with the application.
Run the job: In the SchedulerX console, select the instance that you want to manage and schedule the job to the instance.
View results: You can query and analyze the execution log of a job in the SchedulerX console.
Step 1: Associate your host with SchedulerX
1.1 Create an application
Log on to the SchedulerX console. In the left-side navigation pane, click Application Management. On the Application Management page, select default namespace in the upper part of the page and click Create application. In the Create application panel, configure the Application Name and Application ID parameters, set the app type parameter to general app and Release to Professional Edition, configure the parameters in the Advanced Configuration section based on your business requirements, and then click Next Step.
ImportantYou must specify a region and a namespace to make sure that resources are deployed in the desired location.
In the Notification configuration step, configure the Notification channel and Notify contact parameters. The application is created.
1.2 Manually deploy the agent
Download and deploy the agent. For more information, see the Manually deploy the agent section of the Use the SchedulerX agent to connect an application to SchedulerX (script or HTTP jobs) topic.
Make sure that the runtime environment is JDK 1.8 to 14. If you use a JDK version later than 14, remove the -XX:+UseConcMarkSweepGC option from the schedulerxAgent/bin/start.sh file in the agent installation directory.

Step 2: Create a job for the host
2.1 Create a job
In the left-side navigation pane, click Task Management. On the Task Management page, click Create task.
In the Basic Configuration step, configure the Task name and Application ID parameters, and set the Task type parameter to ScriptTask, Script to shell, Execute Command to
echo Agent connects to SchedulerX, File format to unix, and Execution mode to Stand-alone operation. Configure the parameters in the Advanced Configuration section based on your business requirements. For more information, see Basic parameters of the Job management topic.
In the Timing configuration step, set the Time type parameter to cron and use the build tool to generate a cron expression. Example: 0 * * * * ?. This expression specifies that the job runs every minute. Configure the parameters in the Advanced Configuration section based on your business requirements. For more information, see Parameters for job scheduling of the Job management topic.

In the Notification configuration step, configure the Notification channel and Notify contact parameters. The job is created. For more information, see Notification channel and contact person of the Job management topic.
2.2 Verify the results
You can find the job on the Task Management page or click Execution List in the left-side navigation pane and click the Task instance List tab.
Step 3: Run the job
On the Task Management page, find the job that you want to manage and click Run once in the Operation column.
Step 4: View the results
In the left-side navigation pane, click Execution List. On the Task instance List tab, find the job that you want to manage and click Log in the Operation column.
If the log displays
Agent connects to SchedulerX, the Shell script is executed by the job.
References
For more information about the terms of SchedulerX, see Terms.
For more information about how to create an application in SchedulerX, see Application management.
For more information about how to connect an application to SchedulerX by using the agent, see Use the SchedulerX agent to connect an application to SchedulerX (Script or HTTP jobs).
For more information about how to create a job in SchedulerX, see Job management.
FAQ
For more information about remote logon failures to ECS instances, see If you want to connect to an instance that resides in a VPC, find a security group to which the instance belongs, go to the Security Group Details page, and then add a rule on the Inbound tab of the Connect to a Linux instance by using a password or key topic.
When you run the wget command on an ECS instance to download the agent, if the connection to the website times out, enable the public IP address or upload a file to a Linux instance. For more information, see Upload a file to a Linux instance.
For more information about frequently asked questions (FAQ), see Index.