## Introduction to the Duplicati Command Line tool The integrated webserver in Duplicati offers a convenient way to schedule and run backup jobs. However, if you can't or don't want to use the graphical user interface and/or the built-in scheduler, you can use the Duplicati Commandline tool. The filename is `Duplicati.CommandLine.exe`, the tool can be found in the Duplicati program folder. With the Commandline tool you can perform all operations that are available in the Graphical User Interface. You can even do more with the Commandline tool. If you want to perform specific operations, like deleting a particular backup or comparing 2 backups, you will not be able to do this in the Graphical User Interface, but the Commandline tool supports these operations. ## How to use the Duplicati Command Line tool The Commandline tool can be used by typing `Duplicati.CommandLine.exe` followed by a number of arguments in a command prompt window. Linux and Mac OS X users should type `mono Duplicati.CommandLine.exe` or `duplicati-cli`, which is a wrapper for running `mono Duplicati.CommandLine.exe`. Which arguments you need to specify depend on the command you run with the Commandline tool. Generally, these arguments need to be supplied: * **The command to execute** This tells the Commandline tool what to do. Supported commands will be described one by one. The Commandline tool supports these commands: `backup`, `find`, `restore`, `delete`, `compact`, `test`, `compare`, `purge`, `vacuum`, `repair`, `affected`, `list-broken-files`, `purge-broken-files` * **Target URL** If the command needs access to the files at the backend, you need to specify the protocol, URL and credentials as the first argument. Example: to access host.myftpserver.com/backup with username User and password Pass, using the FTP protocol, the target URL will be: `ftp://User:Pass@host.myftpserver.com` Each storage provider has its own set of required and optional parameters. See [Storage Providers](../05-storage-providers) for more info about specific backends. * **Command arguments** Some commands need additional information. For example, if you want to compare 2 backups, you have to specify which 2 backups from the available list Duplicati should compare. * **Advanced options** Duplicati offers a wide range of advanced options. With advanced options you give Duplicati additional information, like the location of the local database, where to store temporary files or information to fine-tune the command you want to execute. There are general advanced options and advanced options for specific storage providers. See< [Storage Providers](../05-storage-providers) and [Advanced options](../06-advanced-options) for more information. Generally, each operation from the command line has the following format: **For Windows:** `Duplicati.CommandLine.exe [storage-URL] [arguments] [advanced-options]` **For Linux and Mac OS X:** `duplicati-cli [storage-URL] [arguments] [advanced-options]` Storage-URL, arguments and advanced-options may or may not be mandatory, depending on the command you execute. ***** > ![](icon_info.png) Advanced options with a value are preceeded with 2 dashes (`--`), followed by an equal=sign (`=`) and the desired value: > `--advanced-option=value` > Advanced options that don't have a value (just turn on an option) can be specified in 2 ways: > `--advanced-option=true` (`--advanced-option=false` disables the option) > `--advanced-option` ***** ***** > ![](icon_important.png) When using the command line tools, if any value (like a password) contains one or more special characters, enclose that value in double quotes or URL encode the special characters in that value. > Keep in mind that this is not necessary when using the Web UI, as the Web UI will automatically convert special characters in the background. In that case, quotes will be considered as a literal part of the value. ***** ***** > ![](icon_info.png) From this point, only Duplicati.CommandLine.exe will be used as reference to the Commandline tool. Linux and Mac OS X users should replace this with duplicati-cli or mono Duplicati.CommandLine.exe. ***** ## Getting help from the Command Line Tools The Commandline tool provides online help with the special `help` command. To get started, type `Duplicati.CommandLine.exe help`. ![](ss_gethelp_01.png) To get help about a specific topic, add it to the help command. So if you need help about the `find` command, type `Duplicati.CommandLine.exe help find`, which will return the following result: ![](ss_gethelp_02.png) ***** > ![](icon_info.png) The special help topic `example` will show a few examples of how the Commandline tool should be used to perform some simple operations. To show the examples, type `Duplicati.CommandLine.exe help example`. ***** ## The BACKUP command This is probably the most important command, after all Duplicati is a backup program. You can run a backup with the backup command using the following format: `Duplicati.CommandLine.exe backup "" []` The storage-URL should be specified in this format: `protocol://username:password@hostname:port/path?backend_option1=value1&backend_option2=value2` Multiple source paths can be specified if they are separated by a space. `username` must not contain `:` and `password` must not contain `@`. If they do, specify username and password using `--auth-username` and `--auth-password`, or url-encode them. Add as many advanced options as needed, like `--passphrase` and `--dblock-size`. ***** > ![](icon_info.png) Instead of composing the complete backup command yourself, including all advanced options, you can create a backup job in the Graphical User Interface, without scheduling it. Once completed, you can export the backup job to the command line, resulting in a Duplicati.CommandLine.exe backup command with all settings that you specified in the wizard. You can paste this generated command in your favorite task scheduler. For more information about creating a backup job in the Graphical User Interface, see [Creating a new backup job](../03-using-the-graphical-user-interface/#creating-a-new-backup-job). For more information about exporting the backup job to the command line, see [Exporting a backup job configuration](../03-using-the-graphical-user-interface/#exporting-a-backup-job-configuration). ***** The Commandline equivalent of the backup job described in [Creating a new backup job](../03-using-the-graphical-user-interface/#creating-a-new-backup-job) is: ```nohighlight Duplicati.CommandLine.exe backup "ftp://myftpserver.com/Backup/Pictures?auth-username=Duplicati&auth-password=backup" "C:\Users\User\Pictures" --backup-name="Pictures Collection" --dbpath="C:\Users\User\DuplicatiCanary\data\LFYXSFKFFN.sqlite" --encryption-module="aes" --compression-module="zip" --dblock-size="50mb" --keep-time="3M" --passphrase="%@/%78kUPKlZtz" --skip-files-larger-than="2GB" --default-filters="Windows" --exclude-files-attributes="temporary" --disable-module="console-password-input" --exclude="desktop.ini" ``` ## The RESTORE command The `restore` command can restore files from a specific restore point to the local system. Use the following format: `Duplicati.CommandLine.exe restore [""] []` This will restore `` to its original location. If the specified filename exists already, a timestamp will be added to the filename. If you want to restore all files, use "*" or leave the filename empty. Some advanced options frequently used with restore operations are: * `--overwrite=` Overwrites existing files. * `--restore-path=` Restores files to instead of their original destination. Top folders are removed if possible. * `--time=