GoAdmio Command Line: bulk with /go/bulk

/go/bulk keeps a list of your servers and runs one command on all of them at the same time. It: It works on servers, not on hosted domains. To run something for every domain on one server, use the command's own all option, for example bot. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Add two servers to the list
/go/bulk add server1.example.com
/go/bulk add server2.example.com

# Run a command on both
/go/bulk /go/restart

Options

Form What it does
/go/bulk add <server> Adds a server to the list. The name must contain a dot.
/go/bulk delete <server> Removes a server from the list. The name must contain a dot.
/go/bulk delete all Deletes the whole server list.
/go/bulk list Shows the server list.
/go/bulk <command> [arguments] Runs the command on every server in the list.
/go/bulk Opens an interactive prompt, bulk>. Each line you type is run on all servers. Type exit or quit to leave.

add, delete, and list are reserved words. You cannot send a remote command that starts with them in these forms.

[!WARNING]
add and delete without a dot in the second argument, and list when no list exists, are not recognized as list commands. Depending on the form, they are sent to the servers as a remote command. Always use full server names.

Requirements

Requirement Detail
Server list At least one server in /var/go/etc/bulk.
SSH Root login with a password must be allowed on each server, on port 22.
Password All servers must accept the same root password, the one stored encrypted in /var/go/etc/go.key.
Tools sshpass, openssl, and ifconfig on this server.

Examples

# Add and list servers
/go/bulk add server1.example.com
/go/bulk list

# Run a command on all servers
/go/bulk /go/update

# Remove one server, then clear the list
/go/bulk delete server1.example.com
/go/bulk delete all

# Interactive mode
/go/bulk
bulk> /go/restart
bulk> exit

# Read the full output of the last run for one server
cat /var/log/go/bulk/server1.example.com.log

Output

For every server, the command saves the output in /var/log/go/bulk/<server>.log. The first line of each file is the server name. These files are deleted at the start of every run, so they only hold the last run.

How the results are shown depends on the number of servers:

Servers Display
1 to 5 Side by side in colored columns, one column per server. Only the first 7 lines of each log are shown, and long lines are cut to fit the column.
More than 5 Each server’s full log, one after another, with a line between them.

Read the log files for the complete output of a run with 5 servers or fewer.

If the list is empty or has no valid names, the command prints No Servers. Each run also adds a line to /var/log/go/bulk.log.

See the full reference at /go/bulk and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *