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:
-
Direct mode (default):
This mode lets you load a configuration and directly start or stop tasks.
-
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.
Usage
1USAGE: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
10Where:11
12 -c <Path>, --config <Path>13 The Configuration file to load. Not supported in remote-control mode.14
15 --remote-control16 Remote control another eCAL Sys instance.17
18 --remote-host <Hostname>19 Set the hostname for remote-controlling.20
21 -s, --start22 Start all tasks.23
24 -x, --stop25 Stop all tasks.26
27 -r, --restart28 Restart all tasks.29
30 --local-tasks-only <true|false>31 Only tasks on local host will be considered. Not supported in32 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 in36 remote-control mode.37
38 --no-wait-for-clients39 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-cloud43 Do not use the monitor to update the tasks for44 restarting/stopping/monitoring.45
46 -i, --interactive47 Start eCAL Sys and listen for commands on stdin. When not in48 remote-control mode itself, eCAL Sys will offer the eCAL Sys Service49 for being remote-controlled. Note that eCAL Sys will exit, when stdin50 is closed. To prevent that, combine this option with51 "interactive-dont-exit". When using interactive mode, waiting for52 ecal_sys_clients is disabled.53
54 --interactive-dont-exit55 When in interactive mode, this option prevents eCAL Sys from exiting,56 when stdin is closed.57
58 --, --ignore_rest59 Ignores the rest of the labeled arguments following this flag.60
61 --version62 Displays version information and exits.63
64 -h, --help65 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:
# 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.
ecal_sys -c ~/tutorial.ecalsys --interactive
Available commands are:
1exit2 Quit eCAL Sys.3
4
5list [--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
11load <Path>12 Loads an eCAL Sys configuration file.13
14
15restart [IDs or names]16 Restart tasks with the given IDs or names. If no ID or name is given, all17 tasks will be restarted.18
19
20sleep <seconds>21 Sleeps for the given amount of time. Usefull when automatically piping input22 to eCAL Sys via stdin.23
24
25start [IDs or names]26 Start tasks with the given IDs or names. If no ID or name is given, all tasks27 will be started.28
29
30stop [IDs or names]31 Stop tasks with the given IDs or names. If no ID or name is given, all tasks32 will be stopped.33
34
35update_from_cloud36 Updates the state of all (eCAL-) tasks that are visible, even if they have not37 been started by this eCAL Sys instance.
Remote-control eCAL Sys
First you need something that can be remote controlled:
# 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.
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 --interactiverem 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