bc-cli
Command line interface for creating and managing BeyondCron jobs.
Usage
bc-cli [--cluster name] [--admin | --user name] [server][:port] ... bc-cli [--admin | --user name] --command command [;command] ... bc-cli --version bc-cli --help
where
--cluster name | of BeyondCron cluster to to connect to. Default is beyondcron . |
--admin | login as the admin user. |
--user name | name of user to login as. Default is the value of the environment variable BEYONDCRON_USER_NAME if defined, otherwise the name of the user executing this command. |
If the environment variable BEYONDCRON_USER_PASSWORD is not defined, the user will be prompted to enter their password. |
|
server | server name/s within the cluster. Default, the value of the environment variable BEYONDCRON_SERVER_NAMES . |
port | server port number. Default, the value of the enviornment variable BEYONDCRON_SERVER_PORT . |
--command command | one or more semicolon separated commands. Returns 0 on success, 1 otherwise. |
--version | print the command version. |
--help | print the command options. |
in order to login as the admin user, this command must be executed on the same server as the BeyondCron server, using the same operating system user id.
Environment variables
BEYONDCRON_CONFIG_SERVICE | Name of the configuration service. If not defined BeyondCron will read startup variables from operating system environment variables. |
JAVA_OPTS | One or more JVM options. e.g. -Xms2T -Xmx2M |
LOG4J_CONFIGURATION_FILE | Location of the log4j configuration file. If this file is named …/log4j2.yaml and does not exist, bc-cli will create and populate it, with the bc-cli defaults. |
Startup variables
Startup variables can be set within a configuration service, or as operating systems environment variables. Startup variables will be read first from a configuration service if defined, and then from environment variables if not defined within the configuration service.
BEYONDCRON_CLUSTER_NAME | Name of BeyondCron cluster to join. Default is beyondcron . |
BEYONDCRON_CLUSTER_PASSWORD | Password of cluster. If password is in the format file:filename, then the password will be read from filename. Default is a cluster specific random string. |
BEYONDCRON_SERVER_ADDRESS_IGNORE | Space separated list of IP address prefixes. When searching for an address, ignore any addresses that begin with one of these prefixes. This can be useful, on servers with one or more management interfaces. |
BEYONDCRON_SERVER_ADDRESS_IPV6 | When searching for an address, prefer an IPv6 address. Default is false . |
BEYONDCRON_SERVER_ADDRESS_PRIVATE | When searching for an address, only chose a private network address. Default is true . |
BEYONDCRON_SERVER_NAMES | One or more space separated server[:port]s to connect to. |
Default is a plumbed IP address that best matches the rules defined by the environment variables BEYONDCRON_SERVER_ADDRESS_PRIVATE , BEYONDCRON_SREVER_ADDRESS_IPV6 & BEYONDCRON_SERVER_ADDRESS_IGNORE . |
|
BEYONDCRON_SERVER_PORT | the server port number. Default is 5701 . |
BEYONDCRON_USER_NAME | Name of user to login as. Default is the name of the user executing this command. |
BEYONDCRON_USER_PASSWORD | Password of user. If password is in the format file:filename, then the password will be read from filename. |
where a parameter is defined on both the command line and as an environment/startup variable, the command line value will be used.
Exit status
bc-cli exits with 0
when closed with the exit
or quit
commands, 1
if an internal error occurred.
Commands
For the commands supported by bc-cli see commands
Examples
Start and interactive session
user1@server1% bc-cli
bc-cli 5.240126.0
user1’s password: ••••••••
BeyondCron % job start /examples/webhooks/random-user
BeyondCron % job status /examples/webhooks/random-user
Job State Result ------------------------------ --------- ------- /examples/webhooks/random-user Scheduled Success
BeyondCron %
Execute a single command
user1@server1% export BEYONDCRON_USER_PASSWORD=secret
user1@server1% bc-cli —command job start /examples/webhooks/random-user
user1@server1% echo $?
0
user1@server1%
Execute a multiple commands
user1@server1% export BEYONDCRON_USER_PASSWORD=secret
user1@server1% bc-cli —command ‘cd /examples/revenue/sales/download; job start store-A; job start store-B’
user1@server1% echo $?
0
user1@server1%
the command should be quoted to ensure the the semicolons separating the BeyondCron commands are not interpreted by the operating system shell.