Preparing a batch file

Use a batch file to run Export Tool, which starts and saves monitoring data in files when you run the batch file.

The installation directory for Export Tool contains four default batch files: runWin.bat, runUnix.bat, delWin.bat, and delUnix.bat. If your computer runs Windows, use runWin.bat and delWin.bat. If your computer runs UNIX, use runUnix.bat and delUnix.bat.

The following examples illustrate scripts in runWin.bat and runUnix.bat batch files. These batch files include a command line that runs a Java command. When you run the batch file, the Java command runs the subcommands specified in the command file and then saves monitoring data in files.

Example batch file for Windows computers (runWin.bat):

java -classpath "./lib/JSanExportLoader.jar" 
-Del.tool.Xmx=536870912 -Dmd.command=command.txt
-Del.logpath=log -Dmd.rmitimeout=20
sanproject.getexptool.RJElMain<CR+LF>
pause<CR+LF>

Example batch file for UNIX computers (runUnix.bat):

#! /bin/sh<LF>
java -classpath "./lib/JSanExportLoader.jar"
-Del.tool.Xmx=536870912 -Dmd.command=command.txt
-Del.logpath=log -Dmd.rmitimeout=20
sanproject.getexptool.RJElMain<LF>

In the previous scripts, <CR+LF> and <LF> indicate the end of a command line.

If the computer running Export Tool communicates directly with the SVP, you usually do not need to change scripts in runWin.bat and runUnix.bat. However, you might need to edit the Java command script in a text editor in some occasions, for example:

  • If the name of your command file is not command.txt
  • If you moved your command file to a different directory
  • If you do not want to save in the log directory
  • If you want to name log files as you like

If the computer that runs Export Tool communicates with the SVP through a proxy host, edit the Java command script in a text editor to specify the host name (or the IP address) and the port number of the proxy host. For example, if the host name is Jupiter and the port number is 8080, the resulting command script would be as shown in the following examples:

Example of specifying a proxy host on Windows (runWin.bat):

java -classpath "./lib/JSanExportLoader.jar"
-Dhttp.proxyHost=Jupiter -Dhttp.proxyPort=8080
-Del.tool.Xmx=536870912 -Dmd.command=command.txt
-Dmd.logpath=log -Dmd.rmitimeout=20 sanproject.getexptool.RJElMain<CR+LF>
pause<CR+LF>

Example of specifying a proxy host on UNIX (runUnix.bat):

#! /bin/sh<LF> 
java -classpath "./lib/JSanExportLoader.jar"
-Dhttp.proxyHost=Jupiter -Dhttp.proxyPort=8080
-Del.tool.Xmx=536870912
-Dmd.command=command.txt
-Dmd.logpath=log -Dmd.rmitimeout=20 sanproject.getexptool.RJElMain<LF>

In the preceding scripts, <CR+LF> and <LF> indicate the end of a command line.

If the IP address of the proxy host is 158.211.122.124 and the port number is 8080, the resulting command script is as follows:

Example batch file for Windows computers (runWin.bat):

java -classpath "./lib/JSanExportLoader.jar"
-Dhttp.proxyHost=158.211.122.124
-Dhttp.proxyPort=8080 -Del.tool.Xmx=536870912
-Dmd.command=command.txt
-Dmd.logpath=log -Dmd.rmitimeout=20 sanproject.getexptool.RJElMain<CR+LF>
pause<CR+LF>

Example batch file for UNIX computers (runUnix.bat):

#! /bin/sh<LF> 
java -classpath "./lib/JSanExportLoader.jar"
-Dhttp.proxyHost=158.211.122.124
-Dhttp.proxyPort=8080 -Del.tool.Xmx=536870912
-Dmd.command=command.txt
-Dmd.logpath=log -Dmd.rmitimeout=20 sanproject.getexptool.RJElMain<LF>

In the above scripts, <CR+LF> and <LF> indicate the end of a command line.

The following examples illustrate scripts in delWin.bat and delUnix.bat files. These batch files include a command line that runs a Java command. When you run the batch file, the Java command is run, and the directories created by Export Tool, and the files in the directories are deleted.

Example batch file for Windows computers (delWin.bat):

java -classpath "./lib/JSanExportLoader.jar"
-Dmd.command=command.txt
-Del.logpath=log
-Del.mode=delete sanproject.getexptool.RJElMain<CR+LF>

Example batch file for UNIX computers (delUnix.bat):

#! /bin/sh<LF> 
java -classpath "./lib/JSanExportLoader.jar"
-Dmd.command=command.txt
-Del.logpath=log
-Del.mode=delete sanproject.getexptool.RJElMain<LF>

For detailed information about syntax of the Java command, see Java.