• 本帖最后由 scerzz 于 2017-4-26 13:16 编辑 *

#!/bin/sh
killall firefox > /dev/null 2>&1
/usr/bin/firefox > /dev/null 2>&1 &
这个sh脚本手动执行可以关闭所有firefox,然后再启动firefox。但是用cron执行时,只会关闭firefox,不会重启浏览器,这是为什么?


在sh脚本中不加 export DISPLAY=localhost:1.0时显示错误:Error: GDK_BACKEND does not match available displays
加上后显示:No protocol specified Error: cannot open display: localhost:1.0