The following commands worked for me (I used firefox
instead of qbittorrent
because I do not have qbittorrent
installed):
$ sudo su
To log in as root and do not change the global crontab table (located at /etc/crontab
).
$ crontab -e
To change the crontab of the root user, with the following entries:
29 * * * * killall firefox
30 * * * * sudo shutdown -r now
35 * * * * su USUARIO -c "DISPLAY=:0.0 firefox"
36 * * * * killall firefox
37 * * * * su USUARIO -c "DISPLAY=:0.0 firefox"
Where USUARIO
can be any user on your system with which you wanted to run the command.
I think your command just was not working because $DISPLAY
was not set, and the cron
program does not understand anything about displaying things on the screen.