I seriously don't understand how to create a simple cron job. The idea is to make mplayer play a certain file at a certain hour.
Here's my attempt:
MIN HOUR * * * /usr/bin/mplayer PATH_TO_THE_FILE > /dev/null 2>&1
It just causes X server to crash. What am I doing wrong?
cron
is not meant to start programs that need X (graphics). Nor are programs started this way able to use Pulseaudio, because in their wisdom the Pulseaudio designers restricted default access to the desktop user. You can cheat in various ways, though. Do you want to play audio, or audio and video? What should happen if no user is logged on? – dirkt Jul 17 '17 at 05:34