Skip to content

eCAL Sys CLI

eCAL Sys can be used purely from command line. The executable is ecal_sys /.exe. It can execute start / stop / restart commands provided from the command line or as well as from an interactive console. The interactive mode can also be used to automatize workflows by automatically piping commands to ecal_sys via stdin.

eCAL Sys CLI features two modes:

  1. Direct mode (default):

    This mode lets you load a configuration and directly start or stop tasks.

  2. Remote control mode:

    This mode will connect to another eCAL Sys host application (GUI or CLI). Commands given to ecal_sys will then be forwarded to the remote-controlled eCAL Sys instance. Use this mode when you want to mainly use eCAL Sys manually (e.g. the GUI) but also automatically send commands to it in certain situation.

eCAL Sys CLI

Usage

sys_cli_usage.txt
1
USAGE:
2
3
ecal_sys [-c <Path>] [--remote-control] [--remote-host <Hostname>] [-s]
4
[-x] [-r] [--local-tasks-only <true|false>]
5
[--use-localhost-for-all-tasks <true|false>]
6
[--no-wait-for-clients] [--disable-update-from-cloud] [-i]
7
[--interactive-dont-exit] [--] [--version] [-h]
8
9
10
Where:
11
12
-c <Path>, --config <Path>
13
The Configuration file to load. Not supported in remote-control mode.
14
15
--remote-control
16
Remote control another eCAL Sys instance.
17
18
--remote-host <Hostname>
19
Set the hostname for remote-controlling.
20
21
-s, --start
22
Start all tasks.
23
24
-x, --stop
25
Stop all tasks.
26
27
-r, --restart
28
Restart all tasks.
29
30
--local-tasks-only <true|false>
31
Only tasks on local host will be considered. Not supported in
32
remote-control mode.
33
34
--use-localhost-for-all-tasks <true|false>
35
All tasks will be considered as being on local host. Not supported in
36
remote-control mode.
37
38
--no-wait-for-clients
39
Don't wait for eCAL Sys clients before starting / stopping tasks.
40
Waiting is always disabled in interactive and remote-control mode.
41
42
--disable-update-from-cloud
43
Do not use the monitor to update the tasks for
44
restarting/stopping/monitoring.
45
46
-i, --interactive
47
Start eCAL Sys and listen for commands on stdin. When not in
48
remote-control mode itself, eCAL Sys will offer the eCAL Sys Service
49
for being remote-controlled. Note that eCAL Sys will exit, when stdin
50
is closed. To prevent that, combine this option with
51
"interactive-dont-exit". When using interactive mode, waiting for
52
ecal_sys_clients is disabled.
53
54
--interactive-dont-exit
55
When in interactive mode, this option prevents eCAL Sys from exiting,
56
when stdin is closed.
57
58
--, --ignore_rest
59
Ignores the rest of the labeled arguments following this flag.
60
61
--version
62
Displays version information and exits.
63
64
-h, --help
65
Displays usage information and exits.
66
67
68
eCALSys

Typical use-cases

The following examples are meant as an orientation how to use eCAL Sys.

Single-shot commands

Loading an .ecalsys file and starting / Stopping all tasks from it:

Terminal window
# Start:
ecal_sys -c ~/tutorial.ecalsys --start
# Stop:
ecal_sys -c ~/tutorial.ecalsys --stop
# Restart:
ecal_sys -c ~/tutorial.ecalsys --restart

Interactive mode

Launch the interactive mode to keep eCAL Sys running, while you can directly type commands. Type help to view a list of all commands available in interactive mode.

If you combine a single-shot command with the interactive mode, eCAL Sys will continue with the interactive mode after it has executed the command. eCAL Sys will not terminate on its own.

Terminal window
ecal_sys -c ~/tutorial.ecalsys --interactive

Available commands are:

sys_cli_interactive_help.txt
1
exit
2
Quit eCAL Sys.
3
4
5
list [--tasks | --groups | --runners ] [ID or name]
6
Prints a list of all tasks / groups / runners. If an ID or name is given,
7
detailed information about that item are printed. If no argument --groups /
8
--runners / --tasks is given, information about tasks are printed.
9
10
11
load <Path>
12
Loads an eCAL Sys configuration file.
13
14
15
restart [IDs or names]
16
Restart tasks with the given IDs or names. If no ID or name is given, all
17
tasks will be restarted.
18
19
20
sleep <seconds>
21
Sleeps for the given amount of time. Usefull when automatically piping input
22
to eCAL Sys via stdin.
23
24
25
start [IDs or names]
26
Start tasks with the given IDs or names. If no ID or name is given, all tasks
27
will be started.
28
29
30
stop [IDs or names]
31
Stop tasks with the given IDs or names. If no ID or name is given, all tasks
32
will be stopped.
33
34
35
update_from_cloud
36
Updates the state of all (eCAL-) tasks that are visible, even if they have not
37
been started by this eCAL Sys instance.

Remote-control eCAL Sys

First you need something that can be remote controlled:

Terminal window
# GUI
ecal_sys_gui ~/tutorial.ecalsys
# CLI (--interactive Flag will prevent the CLI from exiting)
ecal_sys -c ~/tutorial.ecalsys --interactive

Now you can use another instance of ecal_sys to remote-control that application. You can use single-shot commands, the interactive mode or both. In remote-control mode you cannot load an .ecalsys file, as this is done by the main application.

The following command will send the start command to your main application and then continue in interactive mode.

Terminal window
ecal_sys --remote-control --remote-host YOUR_HOSTNAME --start --interactive

Automatize eCAL Sys CLI

You can use the ecal_sys interactive mode to automatize it via STDIN. Commands are read line-by-line, i.e. they have to be divided by \n. Semicolons do not work. The most concise would probably be to write all your commands in a text file and pipe the content of that to ecal_sys.

  • Ubuntu:

    Terminal window
    # Commands from command line:
    printf "Start \n Sleep 10 \n List \n Stop \n Sleep 5" | ecal_sys -c ~/tutorial.ecalsys --interactive
    # Commands from a file:
    cat commands.txt | ecal_sys -c ~/tutorial.ecalsys --interactive
  • Windows CMD.exe:

    Terminal window
    rem Commands from command line:
    (echo Start & echo Sleep 10 & echo List & echo Stop & echo Sleep 5) | ecal_sys -c tutorial.ecalsys --interactive
    rem Commands from a file:
    more commands.txt | ecal_sys -c tutorial.ecalsys --interactive
  • Windows PowerShell:

    Terminal window
    # Commands from command line:
    echo "Start `n Sleep 10 `n List `n Stop `n Sleep 5" | ecal_sys -c tutorial.ecalsys --interactive
    # Commands from a file:
    cat commands.txt | ecal_sys -c tutorial.ecalsys --interactive