executeCommand

Executes a system command. Because this Change Type doesn’t generate SQL like most, using Liquibase commands such as migrateSQL may not work as expected. Therefore, if at all possible use Change Types that generate SQL.

Available attributes

Name Description Required for Supports
executable Name of the executable to run all all
os List of operating systems on which to execute the command (taken from the os.name Java system property) all
timeout Timeout value for executable to run all

Nested properties

Name Description Required for Supports Multiple allowed
args? / arg Arguments for the executable all yes

Nested property attributes

  • value: Value of the parameter. (E.g. '-param')

XML example

<changeSet  author="liquibase-docs"  id="executeCommand-example">  
    <executeCommand  executable="mysqldump"  
            os="Windows 7"  
            timeout="10s">  
        <arg  value="-out"/>  
        <arg  value="-param2"/>  
    </executeCommand>  
</changeSet>

YAML example

changeSet:  
  id:  executeCommand-example  
  author:  liquibase-docs  
  changes:  
  -  executeCommand:  
      args:  
      -  arg:  
          value:  -out  
      -  arg:  
          value:  -param2  
      executable:  mysqldump  
      os:  Windows 7  
      timeout:  10s

JSON example

{  "changeSet":  {  "id":  "executeCommand-example",  "author":  "liquibase-docs",  "changes":  [  {  "executeCommand":  {  "args":  [  {  "arg":  {  "value":  "-out"  }  },  {  "arg":  {  "value":  "-param2"  }  }]  ,  "executable":  "mysqldump",  "os":  "Windows 7",  "timeout":  "10s"  }  }]  }  }

Database support

Database Notes Auto rollback
DB2/LUW Supported No
DB2/z Supported No
Derby Supported No
Firebird Supported No
H2 Supported No
HyperSQL Supported No
INGRES Supported No
Informix Supported No
MariaDB Supported No
MySQL Supported No
Oracle Supported No
PostgreSQL Supported No
SQL Server Supported No
SQLite Supported No
Sybase Supported No
Sybase Anywhere Supported No