The following commands worked for me (I used firefox
in place of qbittorrent
because I don’t have qbittorrent
installed):
$ sudo su
to log in as root and nay change the global crontab table (located in /etc/crontab
).
$ crontab -e
to change the root user crontab, 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 of your system with which you wanted to run the command.
I believe your command just wasn’t working because $DISPLAY
was not defined, and the program cron
doesn’t understand anything about displaying things on the screen.
Already tried this 30 23 * * * root shutdown -h now?
– Vinicius Zaramella
@Viniciuszaramella already Feb 12 16:13:01 CRON magnet[9147]: (root) CMD (shutdown -h now)
– Kleber Souza