crontab 每20秒执行一次
方案一:
*/1 * * * * sleep 20 && /bin/bash /var/ftp/test.sh
*/1 * * * * sleep 20 && /bin/bash /var/ftp/test.sh
*/1 * * * * sleep 20 && /bin/bash /var/ftp/test.sh
方案二:
*/1 * * * * /bin/bash /var/ftp/test.sh
cat /var/ftp/test.sh
step=20
i=0
while i<=60
do
/bin/bash /var/ftp/test.sh
i+=$step
sleep()
done
方案三:
* * * * * for i in {1..12}; do /bin/bash /var/ftp/test.sh; sleep 20; done
方案四:
* * * * * REMAIN=60 INC=20; while; do /bin/bash /var/ftp/test.sh; sleep $INC; REMIN=$(($REMAIN - $INC));
方案五:
* * * * * sleep 20; /bin/bash /var/ftp/test.sh
* * * * * sleep 40; /bin/bash /var/ftp/test.sh
* * * * * sleep 60; /bin/bash /var/ftp/test.sh
阅读(4565) | 评论(0) | 转发(0) |