Start of Content Area

Background documentation Batch Mode in the CBS Tool  Locate the document in its SAP Library structure

The CBS command line tool runs in batch mode if command line parameters are passed when it is launched. In batch mode the tool processes all commands that have been passed and terminates afterwards.

Below an example is given for the Windows platform how the tool is launched in batch mode.

Note

Commands have to be separated by semicolon.

Example

C:cbstool_win> cbstool_nw.bat connect -c http://server:port -u someuser -p rightpwd; bsstate -b mybuildspace

·        It is possible to collect commands in a text file. Here you have to separate commands by semicolon as well. The text file can be passed via command line to the tool. Note that you have to put an @ character before the file name in order to distinguish a file name from a command

Example

C:cbstool_win>cbstool @commandfile.txt

·        So if you have a certain sequence of commands that you want to execute periodically, you can collect those commands in a text file and pass this text file as in the example above.

·        Alternatively, you can collect a certain sequence of commands into batch files or shell scripts. You are strongly discouraged from changing the files cbstool_nw.bat, cbstool.bat, cbstool.sh provided by the installation. Instead you should write another batch file or shell script where you call the batch file or shell script that launches the CBS tool.

Example

Below you see the content of a batch file that contains several calls of batch file cbstool_nw.bat:

call cbstool_nw.bat help; help connect

call cbstool_nw.bat connect -c http://server:port -u someuser -p rightpwd; bsstate -b mybuildspace

·        You can write a shell script that contains calls of shell script cbstool.sh.

For batch processing it is important to know that the CBS tool gives a return code back when it terminates. This return code is the status code of the last executed command. A value different then 0 means that a problem occurred. Therefore it is recommended to check the return code in batch files or shell scripts, which launch batch processing

 

 

 

 

End of Content Area