shell定时任务

来源:互联网 发布:对云计算的看法 编辑:程序博客网 时间:2024/06/13 23:43

(1)crontab -e

  55 14 * * * cd /crontab/ios_push;/bin/sh  /crontab/ios_push/ios_push_redis.sh >a.out

(2) /os_push_redis.sh脚本内容


#!/bin/bash

while true
do
        a=`/usr/bin/php ios_push_redis.php`
        if [ "$a" = "runend" ]
        then
                echo $a;
                break;
        fi
        echo $a 
        sleep 1
done

0 0
原创粉丝点击