【问题标题】:cron job not working for xwindowcron 作业不适用于 xwindow
【发布时间】:2013-02-06 16:00:38
【问题描述】:

我在 crontab 中有以下行 */1 * * * * xeyes

它没有显示任何 xwindow 而是相反 */1 * * * * touch somefile.txt 工作正常

试图在谷歌上搜索,但没有得到任何具体答案!

【问题讨论】:

  • env DISPLAY=:0 xeyes

标签: bash cron crontab


【解决方案1】:

如果你运行的命令使用它,你必须告诉 cron 在哪里可以找到 X 服务器。

所以使用:env DISPLAY=:0.0 xeyesexport DISPLAY=:0.0; xeyes

一些 cron 实现(Debian、Ubuntu、...)允许简单地在 cron 文件中设置环境。

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

【讨论】:

    猜你喜欢
    • 2016-07-22
    • 2014-04-26
    • 2015-10-29
    • 2017-11-12
    • 2012-04-28
    • 2011-03-08
    • 2020-09-03
    • 2014-07-27
    • 2014-10-22
    相关资源
    最近更新 更多