我可以访问Linux CentOS盒。(我不能悲伤地使用crontab )
当我每天需要运行一个任务时,我只是创建了一个有睡眠的无限循环。(它跑,睡觉~24小时,然后再跑)
#!/bin/sh
while :
do
/home/sas_api_emailer.sh |& tee first_sas_api
sleep 1438m
done最近我有一项任务需要每天早上6:00在特定时间运行(我不能使用crontab)
如何创建只执行@ 6:00上午6:00的无限循环?
发布于 2016-02-10 19:53:40
检查循环中的时间,如果不是您想要的时间,则睡一分钟。
while :
do
if [ $(date '+%H%M') = '0600' ]
then /home/sas_api_emailer.sh |& tee first_sas_api
fi
sleep 60
done发布于 2016-02-10 20:00:35
你(至少!)三种选择:
例如:at -f myjob noon
下面是关于at:http://www.thegeekstuff.com/2010/06/at-atq-atrm-batch-command-examples/的更多信息
https://stackoverflow.com/questions/35324020
复制相似问题