If you want to play audio with a cron job Source Get your user ID. $ id -u <user_name> 1000 Then add the line below to crontab -e. XDG_RUNTIME_DIR=/run/user/<user_id>