At work we have a Raspberry Pi 2+ connected to a monitoring screen (a Panasonic TV) to display the current status of Icinga2 monitoring and some additional visual monitoring (Nagvis) drawings.
I wanted to troll my colleagues by playing a regular video/sound from a scene of the movie Dante's peak (It's coffee time!). I was able to play the video without problems from the command line using "cvlc", however when the command was launched as a cron job, nothing happened.
This was due to the fact, that inside cron's environment, there is no display ($DISPLAY) configured. In order to do that, the cron command needs to use the local DISPLAY port:
00 09 * * 1-5 DISPLAY=127.0.0.1:0 /usr/bin/cvlc /home/pi/Downloads/COFFEE-TIME.webm; killall vlc
Update January 22nd 2019:
You may want to read the follow-up article "How to play an audio file on the command line or as a cron job in Linux".
No comments yet.
Personal Internet VMware PHP Linux Shell Bluecoat Proxy Windows Hardware Virtualization Nagios MySQL DB Monitoring Mail Android Network Wyse Hacks Tomcat Postgres Apple Mac Backup BSD ZFS Solaris SmartOS Unix Multimedia Perl Database MongoDB CMS OTRS FreeBSD Wordpress LXC Nginx Proxmox DNS Graphics GlusterFS Security Chef HAProxy Icinga Ansible HTML MariaDB Containers Rancher Docker AWS ELK Kibana Logstash Filebeat Varnish PGSQL PostgreSQL ElasticSearch CouchDB Bash Macintosh Container Minio Grafana InfluxDB Databases NFS OSSEC SystemD Java Zoneminder Surveillance Elasticsearch SSL TLS Icingaweb2 Cloud Wireless Kubernetes Ubuntu