I m trying to run a cron which involves opening a graphical program and thus needs a DISPLAY set. I have tried the following:
* * * * * DISPLAY=:0.0 /opt/firefox/firefox -print ..
It does not work and even if I try it on my console the above command does not work. It just sits there doing nothing. Now, the only way it works is the following:
$ echo $DISPLAY
localhost:10.0
$ crontab -l
* * * * * DISPLAY=:10.0 /opt/firefox/firefox -print ..
and this works if I stay logged into the machine and wait for the cron to run.
Is there a viable way to make this work? the only way I can thin of is to always stay logged into the machine (which I want to avoid).