定时执行命令

10月以前  |  阅读数:384 次  |  编程语言:Shell 
#!/bin/bash

# 设置命令
command="echo hello"

# 设置执行周期(以秒为单位)
period=10

# 定时执行命令
while true
do
  eval ${command}
  sleep ${period}
done

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8