run
The run command applies to both the DiffDog Server executable and DiffDog Command Line Client. The run command runs a comparison and accepts the following arguments:
•*.dirdif (directory comparison)
•*.filedif (file comparison)
•*.dbdif (database data comparison)
You can create .filedif and .dirdif files with Altova DiffDog desktop application (https://www.altova.com/diffdog), by saving any file or directory comparison as a file. Database data comparisons (.dbdif) can be created only in DiffDog Enterprise edition.
Running *.filedif and *.dirdif files with DiffDog Server is supported only on Windows. For the comparison to be successful, all the file or directory paths that were valid on the desktop machine must be valid on the server machine. If you set up the comparison jobs directly in DiffDog Server (as opposed to using *.filedif or *.dirdif files), you can run them regardless of the platform.
Running *.dbdif files with DiffDog Server is most convenient if DiffDog Server runs either on the same computer as DiffDog desktop, or on a Windows machine. If DiffDog Server runs on a different machine or operating system, the following limitations apply:
•If the comparison involves CSV files, running .dbdif files is supported only on Windows servers. For the comparison to be successful, all the CSV file paths that were valid on the desktop machine must be valid on the server machine. •If database connections are involved, the server machine must be configured and capable to handle the database connection. Namely, the database drivers and any other prerequisites required by the connection must be present on the target operating system as well. For example, if the .dbdif file includes a connection that requires an ODBC driver from the database vendor, that driver must be installed on the server machine as well. Note that some database connection methods supported on Windows are not supported on Linux and macOS. For more information, see Supported Databases.
If you set up comparison jobs directly in DiffDog Server (as opposed to using *.dbdif files), you can run them regardless of the platform. |
After executing the run command, DiffDog Server reports the outcome of the comparison using a return status code (0 = no differences, 1 = differences, 2 = error), similar to how it works with the diff command. The output is displayed directly at the command line, unless you suppress it with the --quiet option.
For .filedif or .dirdif comparisons, you can optionally redirect the output (the comparison result) to a report file in XML or text format. The path of the report file is defined from the graphical user interface of DiffDog desktop application. Namely, in DiffDog, you can set the output path of a .filedif or .dirdif comparison as follows:
1.Open an existing .dirdif or .filedif file (or create a new comparison) in DiffDog.
2.On the Tools menu, click Comparison Document Options.
3.Do one of the following:
a.To use no redirection to a file, click No Export (this is the default option).
b.To redirect the report to a text file, click Text file, and then enter the path in the adjacent text box.
c.To redirect the report to an XML file, click XML file, and then enter the path in the adjacent text box.
4.On the File menu, click Save As, and then save the comparison as .filedif (or .dirdif, if applicable).
For .dbdif comparisons, the outcome of the comparison is available only in XML format. Use the command shell redirection to redirect the output to a file, for example:
<executable> run comparison.dbdif >"C:\result.xml" |
Note: | The --server and --port options do not apply if this command is run for the DiffDog Server (not client) executable. |
Syntax
<executable> run [options] {FILES} |
The run command can also be called using the import or load aliases. Therefore, you can use run, import or load interchangeably.
Arguments
comparison-file
Specifies the path to a comparison file in .dirdif, .filedif, or .dbdif format. The path of the comparison file can be absolute or relative to the current working directory. You can supply as many comparison files as arguments as required. This is limited only by the number of input characters supported by your command shell.
Options
--config, --c
This option specifies the path to a client configuration file where the connection details to DiffDog Server are defined.
If you do not set the --c option, the DiffDog Command Line Client executable attempts to read the client configuration file from the same directory. If there is no configuration file in the same directory as the executable, the default values as described in the command line help and this documentation apply.
--port
This option specifies the port on which DiffDog Server listens for requests. Setting this option is meaningful if DiffDog Server runs on a port other than the default 29800. As an alternative to setting this option at the command line, you can set it in the Client Configuration File. Note that, if you set this value at the command line, it takes precedence over the one defined in the configuration file.
--quiet, --q
Prevents the standard output from being displayed at the command line. Valid values:
true | Do not display standard output in the terminal window. |
false | (Default) Display standard output in the terminal window. |
--loglevel, --L
Sets the reporting level for information, warning, and error messages. Valid values:
none | Suppress all logging. |
info | Report information, warning, and error messages. |
warning | Report error and warning messages. |
error | (Default) Report only error messages. |
--output-mode, --om
This option specifies the output format of the generated report. The following values are supported: auto (default), text, sql, xml, html.
Note the following point about the sql value:
Output the report in SQL format. This value is meaningful when the right side of the data comparison is a database. It contains SQL statements that merge data from the left to the right side of the comparison. For example, if there are missing rows on the right, INSERT statements are generated. Conversely, if there are extra rows on the right, DELETE statements are generated. For changed values, UPDATE statements are generated.
--server
This option specifies the server address on which DiffDog Server listens for requests. Setting this option is meaningful if DiffDog Server runs on a server other than the default localhost. As an alternative to setting this option at the command line, you can set it in the Client Configuration File. Note that, if you set this value at the command line, it takes precedence over the one defined in the configuration file.
--alias
Specifies which alias to use then the server is running in restricted mode.
Examples
The command below calls the DiffDog Client executable to run the comparison file C:\DiffDog\Comparison1.filedif:
DiffDogCmdlClient run C:\DiffDog\Comparison1.filedif |
The command below calls the DiffDog Client executable to run the comparison files Comparison1.filedif and Comparison2.dirdif:
DiffDogCmdlClient run C:\DiffDog\Comparison1.filedif C:\DiffDog\Comparison2.dirdif |