首页 > 解决方案 > 使用 cron 运行带有 Xvfb 显示的 sh?

问题描述

我正在尝试使用 cron 运行 sh 脚本。此脚本需要显示。

我努力了:

# Xvfb display
/usr/bin/Xvfb :10 -ac -screen 0 1024x768x24 &
41 18 * * * /bin/sh /path/to/script/script.sh > /path/to/log/log.log 2>&1

什么也没发生,log.log 也没有创​​建。

第二次尝试:

43 18 * * * <user> export DISPLAY=:10 /bin/sh /path/to/script/script.sh > /path/to/log/log.log 2>&1

同样的结果没有日志文件。

(ubuntu) CMD (export DISPLAY=:10 /bin/sh /ibc.paper/twsstart.sh > /crontry.log 2>&1) Jun 14 18:43:01 CRON[1809]: (CRON) info (No MTA已安装,丢弃输出)

我一直在尝试所有我能想到的东西,但没有任何效果。

有人可以告诉我要检查什么吗?

标签: bashcronxvfb

解决方案


推荐阅读