fedarovich / qbittorrent-cli

Command line interface for QBittorrent
MIT License
303 stars 16 forks source link

crontab can't run qbt, why? #39

Closed PHCSJC closed 8 months ago

PHCSJC commented 3 years ago

this is success in shell, I have config user password url by "qbt settings set": qbt torrent list

this is also success in crontab: 03 13 * qbt torrent --help >>/tmp/ccc 2>>/tmp/ccc

but, this is failed in crontab, never running, /tmp/ccc is empty 03 13 * qbt torrent list >>/tmp/ccc 2>>/tmp/ccc

thanks!

my system is debian 10 x64. qbt --help 1.5.19350.1

QBittorrent version: 4.1.5 API version: 2.2.0 Legacy API version: 23 Legacy API min version: 23

fedarovich commented 3 years ago

I need to investigate why it outputs nothing.

Are you running qbittorent and qbt on the same machine and on the default port? If not, you may need to explicitly specify --url parameter in the command if running from crontab.

fedarovich commented 8 months ago

As there is no screen available when the command is run by cron, it will fail with the default output format as it tries to get the screen witdh. JSON or CSV output format must be used for non-interactive scenarios, e.g.

qbt torrent list -F json