I have added a cron job to execute a python script that is dependent on wmctrl. The job would fail to execute properly and I have traced this to the fact that the cron job seems to be unable to use/find wmctrl.
I have one cron task added to my tab as follows:
* * * * * /home/tim/wmctrl -h > /home/tim/log.txt
but the result log.txt file is empty. This command works fine from the command line.
My cron env is as follows:
HOME=/home/tim
LOGNAME=tim
PATH=/usr/bin:/bin
SHELL=/bin/sh
PWD=/home/tim
and wmctrl is found in /usr/bin/
I have tried other plain python scrips and applications which all seem to be working fine.
Any help or suggestions would be greatly appreciated.
croncan't findwmctrl, but rather thatwmctrldoesn't have access to yourDISPLAYand other variables that would enable it to talk to the appropriate other processes it needs to to accomplish what you're asking it to do.cronjobs run in a rather limited user environment. – twalberg Apr 23 '13 at 14:31/home/tim/wmctrl: something like/bin/sh /home/tim/wmctrl– fedorqui 'SO stop harming' Apr 23 '13 at 15:22