Command Line
The desktop program is started with fatrat. A headless build, without the desktop window, is installed as fatrat-nogui. Both take the same options, except where noted below.
fatrat [options] [links ...]
fatrat --help prints the options your build supports. The manual page, man fatrat, lists most of them (it has no entry for --rest-socket).
Options
Options are case-insensitive, and each is given separately. Options that take a value (-c, -p, -u, --rest-socket) read the next argument as the value. If it is missing, FatRat prints a message and exits with status 1.
-f,--force- Start even if FatRat is already running. See "One instance at a time" below.
-i,--hidden- Desktop only. Start with the main window hidden. This works only if the tray icon exists.
fatrat-noguiaccepts the option and ignores it. -n,--nogui- Desktop only. Start with no window at all. FatRat keeps running in the background, and you control it with the web interface or the terminal interface.
fatrat-noguidoes this without the option, and accepts the option too. -d,--daemon- Run in the background as a daemon. This implies
--nogui. -c,--configfile- Use file (an INI file) to store the settings, instead of the default settings file,
~/.config/Dolezel/fatrat.conf. Thefatrat-confcommand takes the same option. --rest-socketpath- Also serve the REST API on a Unix socket at path. The socket has no authentication and mode 0600. It is available only if FatRat was built with the web interface; otherwise FatRat prints a message and exits with status 1. See REST API.
--syslog- Also send the contents of the global log to syslog.
-p,--pidfilefile- Write the process ID to file. FatRat removes the file when it exits normally.
-u,--useruser[:group]- Run as user (and as group, if given) instead of the user who started FatRat. Use it when you start FatRat as root. If you leave out the group, FatRat uses the primary group of user. When started as root, it also replaces the supplementary groups with those of user. The process ID file, if any, is handed over to user, so FatRat can still remove it on exit.
--no-python- Turn off support for Python extensions. This option is listed only if FatRat was built with extension support. See Extensions.
-h,--help- Print the list of options and exit.
The options are read from left to right as they are found. The -i and -n options are not listed by --help in a build without the desktop window. For running FatRat as a service, see Running on a Server.
Passing links
Any argument that does not start with - is a link. To open the New transfer dialog with the links already filled in, pass them as arguments:
fatrat "http://example.com/a.zip" "http://example.com/b.zip"
This works only with the desktop window. The headless fatrat-nogui does not show a dialog, and ignores the links.
One instance at a time
At startup FatRat asks D-Bus whether another instance is already running. If one is, FatRat does not start a second one, and exits with status 0 after one of these:
- If you passed links, it sends them to the running instance, which opens its New transfer dialog (the headless
fatrat-noguionly logs a note and adds nothing). You do not need a running instance for this to work: if there is none, FatRat starts and opens the dialog itself. - If you passed no links, it tells you that an instance is already running. The desktop program shows this in a message box;
fatrat-noguiprints it to the standard error output.
Pass --force to skip the check. Without D-Bus support in the build, FatRat does not make the check at all.
Exit status
- 0 after
--help, and when FatRat found a running instance and handed over to it. - 1 if
-c,-p,-uor--rest-sockethas no value, or the build has no web interface and you pass--rest-socket. - 1 if
--usernames a user or group that cannot be found, or FatRat cannot switch to it. - The value of
errnoif the--pidfilecannot be written.
Unknown options
FatRat prints Ignoring unknown option and the option to the standard error output, and carries on. The argument after an unknown option is not skipped, so it is still used as a link or as the next option.