Scripting & output
stdout is for tickets
Section titled “stdout is for tickets”Each ticket goes to stdout as one <ticket> <key> line, and everything
else (progress, status, warnings) goes to stderr. So this works:
deaddrop serve x.torrent > tickets.txt &# ...laterread -r TICKET KEY < tickets.txtAfter a reset, the server prints the new ticket and
key as another line. deaddrop reset prints the same line, so you can capture
it directly:
read -r TICKET KEY < <(deaddrop reset "$TICKET" 'magnet:?xt=...')Exit status
Section titled “Exit status”| Code | Meaning |
|---|---|
0 |
Success, including a single-use server shutting down after its download, and Ctrl-C. |
1 |
Error. |
2 |
Bad command-line usage. |
Logging
Section titled “Logging”Release builds (cargo build --release) log nothing by default. Debug builds
log warnings. Set RUST_LOG or log in the config file
to change that, or off to turn logging off in any build:
RUST_LOG=info deaddrop serve x.torrentRUST_LOG=deaddrop=debug,librqbit=info deaddrop serve x.torrentThis only covers the log output from deaddrop and its libraries. The status lines (progress, the ticket, reset messages) are always printed to stderr.
deaddrop --help (or deaddrop help <command>) has the full reference:
examples, environment variables, config precedence and exit codes. -h gives
a shorter summary.