I have a Raspberry Pi 2, which I use as kiosk, for that I have installed Raspbian based FullPageOS distro.
Everything works fine, except some commands fail silently when trying to run from crontab.
I have 2 commands for switching kiosk on and off at certain times by the pi user:
$crontab -l -u pi # m h dom mon dow command 05 9 mon-fri * * /bin/bash /home/pi/scripts/dispon.sh >> /tmp/cronjob.log 2>&1 15 18 mon-fri * * /usr/bin/xset -display :0 dpms force off >> /tmp/cronjob.log 2>&1 */3 * * * * /usr/bin/touch /tmp/1111 >> /tmp/cronjob.log 2>&1
As you can see, I have tried it different ways: to execute xset directly in the monitor off sequence, and as part of script, when executing the monitor on.
Contents of the dispon.sh script (it is chmod a+x):
#!/bin/bash xset -display :0 dpms force on xset -display :0 -dpms
Neither of commands appear to work (display doesn't turn on/off) and neither leaves any error message in /tmp/cronjob.log
The touch command does work and touch the file though.
dispon.sh work fine when run by pi user from SSH connection.