Kaunteya
Kaunteya

Reputation: 3090

cron job not working for xwindow

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!!

Upvotes: 0

Views: 832

Answers (1)

kamilpp
kamilpp

Reputation: 117

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

Upvotes: 3

Related Questions