**自启脚本,防止计划任务中断。**
~~~
cd /www/wwwroot/duo
~~~
~~~
chmod -R 777 cronjob
~~~
在宝塔中如下图所示。



以下命令分别在计划任务中,添加两个。每分钟执行。
setting cronjob per 1 sec running.
name 1: phpcron
~~~
/www/wwwroot/duo/cronjob/crontab.sh
~~~
name 2: srscron
~~~
cd /srs/srs/trunk && ./objs/srs -c /srs/srs/trunk/conf/http.flv.live.conf &
~~~
name 3: auto remove vanc data
~~~
php /www/wwwroot/duo/cronjob/del.php
~~~

直播服务自启
~~~
vim /etc/rc.local
~~~
最后添加以下代码
~~~
cd /srs/srs/trunk && ./objs/srs -c /srs/srs/trunk/conf/http.flv.live.conf &
~~~
最后确认是否正常运行
Check cronjob is running
~~~
ps aux|grep cronjob
ps aux|grep srs
~~~

最后,重启系统。(at last reboot systemt)
登录后SSH执行 (use ssh command)
~~~
ps aux|grep cronjob
ps aux|grep srs
~~~

如果看到以上图中所示说明成功了。
if you see like pic show, cronjob is working.