在特定时间运行命令 [英] Run a command at a specific time

查看:195
本文介绍了在特定时间运行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在特定时间运行命令。我看了看在命令,但我不知道如何得到它的工作...

I'm trying to run a command at a specific time. I've looked at the "at" command, but I don't know how to get it working...

下面是我做的:

at 1843 (Enter)
php /run/this/script.php (Ctrl+D)

但我怎么做这在bash脚本?我的意思是,我需要preSS进入和Ctrl + D键来设置延迟...如何在脚本中做到这一点?

But how do I do this in a bash script? I mean, I need to press enter and "Ctrl+D" to set up the delay... How to do this in a script?

任何建议非常受欢迎的。

Any suggestions most welcome.

由于提前,

推荐答案

您可以试试这个:

at 1843 <<_EOF_
php /run/this/script.php
_EOF_

修改的,如果你想要做的就是使用Firefox的东西,试试这个:

edit if what you want to do is run Firefox, try this:

at 1843 <<_EOF_
DISPLAY=:0.0 /usr/bin/firefox
_EOF_

这篇关于在特定时间运行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆