如何运行cron工作每2小时 [英] How to run cron job every 2 hours

查看:673
本文介绍了如何运行cron工作每2小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ubuntu的新手。我想每2小时执行一次工作。

I'm new to ubuntu. I want to run a task every 2 hours.

更新:解决问题:

0 */2 * * *  /home/username/test.sh 


推荐答案

您已关闭,只需执行:

0 */2 * * *  /home/username/test.sh 

不要忘记,你可以检查syslog, !
在开头检查0,否则它将每两分钟运行一次。

Don't forget, you can check syslog to see if it ever actually ran! check 0 in the beginning otherwise it will run every minute every two hour.

这篇关于如何运行cron工作每2小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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