服务开机自启任务配置
将一些自启脚本放置到/etc/init.d目录下,然后编辑 /etc/rc.local。
在启动脚本时可以打印一些状态信息,用于后期排查使用!!!
#!/bin/bash
#echo "hello" > /root/autostart.log
date >> /root/autostart.log
/etc/init.d/xxx.sh start
[ $? = 0 ] && echo "xxxx start success" >> /root/autostart.log
exit 0
系统定时任务
可以编辑crontab -e,然后加入定时任务