加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Cron工作 – 每5秒运行一次

发布时间:2020-12-15 18:57:48 所属栏目:安全 来源:网络整理
导读:我想创建一个每5秒运行一次脚本的cron作业.看到cron作业只允许分钟0-59的增量,依此类推. 我想创建另一个脚本,调用下面写的原始脚本. #!/bin/bashwhile truedo# script in the same directory as this script. is this correct?bash makemehappy.shsleep 1don
我想创建一个每5秒运行一次脚本的cron作业.看到cron作业只允许分钟0-59的增量,依此类推.

我想创建另一个脚本,调用下面写的原始脚本.

#!/bin/bash

while true
do
# script in the same directory as this script. is this correct?
bash makemehappy.sh
sleep 1
done

我现在需要知道如何在每次启动计算机时运行此脚本,并且如果由于某种原因它没有运行则需要启动它.

我也知道每分钟运行这个脚本不是一件好事.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读