#!/bin/bash
ddd=$(date +%Y-%m -d "-1 month")
xmessage -timeout 10 $ddd
If I try this simple script I get this to work fine from terminal but when I start this script via cron
the variable is always empty? I have tried many different syntax but the result is the same. Works in Terminal but not from cron.
set | grep DISPLAY
to see what is your display (probablyDISPLAY=:0
). Use that line before calling xmessage, so it will know where to display. – nobody Dec 26 '17 at 13:35/var/log/syslog/
, it may contain more information on what cron is stumbling upon. – Harald Dec 27 '17 at 13:00