The software described in this documentation is either no longer supported or is in extended support.
Oracle recommends that you upgrade to a current supported release.

1.2 About spacecmd

The spacecmd utility provides a command-line interface that you can use to perform most of the actions that you can perform using the web interface.

You can run spacecmd either directly on the Spacewalk server or remotely. If you run spacecmd remotely, specify the server by its IP address or resolvable domain name, for example:

$ spacecmd -s swksvr.mydom.com
Welcome to spacecmd, a command-line interface to Spacewalk.

Type: 'help' for a list of commands
      'help <cmd>' for command-specific help
      'quit' to quit

Spacewalk Username: swadmin
Spacewalk Password: password
INFO: Connected to https://swksvr.mydom.com/rpc/api as swadmin
Note

You must authenticate yourself as a Spacewalk user with an assigned role with sufficient privileges to perform the requested actions.

As an alternative to entering the Spacewalk user name and password at the prompts, you can use the -u and -p options to specify these values.

To display a list of spacecmd shell commands, type help.

To display more help about a command, type help command.

To exit the shell, type exit or quit.

spacecmd attempts [Tab] completion of partial commands or arguments.

You can run spacecmd as an interactive shell or non-interactively. This guide includes examples of using the interactive shell. If you want to run spacecmd non-interactively, specify the spacecmd shell command and its arguments after a -- delimiter, for example:

$ spacecmd -s swksvr.mydom.com -u swuser -p password -- \
  softwarechannel_create -l oraclelinux6-u6-x86_64-patch \
  -n "Oracle Linux 6 Update 6 x86_64 Patch Channel" \
  -p oraclelinux6-u6-x86_64 -a x86_64
INFO: Spacewalk Username: swuser
INFO: Connected to https://swksvr.mydom.com/rpc/api as swuser
$ spacecmd -s swksvr.mydom.com -u swuser -p password -q -- \
  softwarechannel_list oraclelinux6-u6-x86_64-patch
oraclelinux6-u6-x86_64-patch
$ spacecmd -s swksvr.mydom.com -u swadmin -p swadmin -q -y --
  softwarechannel_delete oraclelinux6-u6-x86_64-patch
Channels
--------
oraclelinux6-u6-x86_64-patch
$ spacecmd -s swksvr.mydom.com -u swadmin -p swadmin -q -- \
  softwarechannel_list oraclelinux6-u6-x86_64-patch

The -q option suppresses informational messages. The -y option specifies that you would answer yes to all prompts to confirm that you want to delete or change data. By default, spacecmd assumes the answer no.

For more information, see the spacecmd(1) manual page.