添加开机自启脚本,注意都需要用绝对路径

psubscribe.sh脚本中的内容:

nohup /usr/bin/php -f /data/aliyun51015cn/redisChannel/psubscribe.php >
psubscribe.log &



 

1、赋予脚本可执行权限(/opt/script/psubscribe.sh是你的脚本路径)

# chmod 777 /data/aliyun51015cn/redisChannel/psubscribe.sh

2、打开/etc/rc.d/rc.local文件,在末尾增加如下内容

# echo "/data/aliyun51015cn/redisChannel/psubscribe.sh" >> /etc/rc.d/rc.local

3、在centos7中,/etc/rc.d/rc.local的权限被降低了,所以需要执行如下命令赋予其可执行权限

# chmod +x /etc/rc.d/rc.local


友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信