如何设置 cron 以显示 gui 应用程序 [英] how to set cron to display gui application
本文介绍了如何设置 cron 以显示 gui 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以通过 cron 在终端或任何其他 gui 中显示结果.
is it possible to show the results in terminal or any other gui by a cron.
例如我只是写了一个脚本来显示每分钟在终端的时间.但它什么也不做.那么cron是否可以在GUI中显示结果.
for example I just write a script to show the time at terminal at each minute. but it does nothing. So is it possible to cron can show results in GUI.
推荐答案
您可以通过将 DISPLAY
变量设置为 :0
来实现此目的.例如:
You can do this by setting the DISPLAY
variable to :0
. For instance:
* * * * * export DISPLAY=:0; gedit
这个 crontab 行会每分钟打开 gui 软件 gedit.
This crontab line will open the gui software gedit every minute.
这篇关于如何设置 cron 以显示 gui 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文