cron job not working for xwindow

♀尐吖头ヾ 提交于 2019-11-27 08:57:43

问题


I have following line in crontab */1 * * * * xeyes

it does not show any xwindow but on the contrary */1 * * * * touch somefile.txt works fine

Tried to search on google but didnt get any specific answers!!


回答1:


You have to tell cron where to find the X server if the command you run uses it.

So use: env DISPLAY=:0.0 xeyes or export DISPLAY=:0.0; xeyes.

Some cron implementations (Debian, Ubuntu, ...) allows to set enviroment simply in cron file.

DISPLAY=:0.0
# m h  dom mon dow   command
*/1 * * * * xeyes


来源:https://stackoverflow.com/questions/15000398/cron-job-not-working-for-xwindow

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!