Home / Repstance User Guide / PROCESS CONTROL COMMANDS / Stop any Capture or Apply Processes

Stop any Capture or Apply Processes

The stop command stops a Capture Process or an Apply Process, all the processes of one kind, or all the processes. Without parameters it stops every process that is running; a process that has failed is stopped as well, and its state changes to stopped. The parameters process and id, the states in which a process accepts the command and the HTTP codes are explained on PROCESS CONTROL COMMANDS.

Command line (repcli)

repcli stop [process=capture|apply [id=processID [restart=1]]]
ParameterDescription
processcapture for the Capture Processes, apply for the Apply Processes. Without it the command is sent to all the processes.
idThe identifier of the process. It needs process. Without it the command is sent to all the processes of that kind.
restart1 stops the process and runs it again as soon as it has stopped. It is written after process and id, so it works with one process. The Web UI uses it for “Restart Now”. A failed process is only stopped.

repcli prints a line for every process the command is meant for: the status in brackets and the message.

StatusMeaning
In ProcessThe command has been sent to the process. The process needs a few seconds to finish its work, use the status command to monitor it: while it stops it shows STOP (In Process), when it has stopped it shows RUN (Completed), Waiting for the Next Command.
FailedThe command has not been sent. The message tells why: the process is stopped already (Command [STOP] is not valid for this status), the id does not exist, or a parameter is wrong (see the messages on PROCESS CONTROL COMMANDS).

Stop all the processes:

repcli stop
[In Process]: Command [STOP] has been sent. Use [status] command to monitor the Capture 1 process
[In Process]: Command [STOP] has been sent. Use [status] command to monitor the Apply 1 process

Stop the same processes again. They are stopped already, so nothing is sent:

repcli stop
[Failed]: Capture 1 Process status is [Completed]. Command [STOP] is not valid for this status
[Failed]: Apply 1 Process status is [Completed]. Command [STOP] is not valid for this status

Stop an Apply Process and run it again at once:

repcli stop process=apply id=1 restart=1
[In Process]: Command [STOP] has been sent. Use [status] command to monitor the Apply 1 process

REST API

  • Endpoint: https://repstance_url/control/process
  • Method: POST
  • Header: Content-Type: application/json and X-Token: token

The body of the request. The element parameters is optional: without it the command is sent to all the processes. To restart one process add the third pair:

{
  "command": "stop",
  "parameters": [
    ["process", "apply"],
    ["id", "1"],
    ["restart", "1"]
  ]
}

The body of the answer is an array with an element for every process the command is meant for. The element names the process in its message:

[
  {
    "command": "STOP",
    "status": "In Process",
    "message": "Command [STOP] has been sent. Use [status] command to monitor the Apply 1 process"
  }
]
HTTP codeMeaning
200The request is valid. The body has an element for every process the command is meant for, with the status In Process or Failed.
401The token is invalid.
422The request is invalid: the JSON, the command, a parameter, or the process does not exist. The body has one element with the status Failed and the message.

What happens when a process stops

  • The state of a process that has stopped is RUN (Completed), Waiting for the Next Command: the run of the process has completed. The Web UI shows it as Stopped (see Status of any Capture or Apply Processes).
  • A stopped process keeps its configuration and its position. When it is run again it continues from the same place.
  • The Capture Processes and the Apply Processes are independent. While an Apply Process is stopped, its Capture Process goes on and the trail files wait for the Apply Process, so keep an eye on the free disk space of the Repstance server (see Housekeeping).
  • A process that you have stopped is not run again by the automatic restart of the failed processes.
  • The position of a stopped process can be changed with reset (see Reset Process).

Web UI

Click “Stop All” on the dashboard to stop all the processes, or “Stop” on the card of a process to stop that process. Both ask for a confirmation. After a change of the configuration of a running process the Web UI offers “Restart Now”, which sends stop with restart=1. The buttons, the confirmations and the state of the cards are shown in Stop/Run Replication Processes.