centos linux 实现开机自动运行脚本

run.sh 文件内容如下:

#!/bin/bash

cd /home/lyh/CMCC
echo "You Haved Started !" > log.txt

/etc/rc.d/rc.local 文件中添加如下内容:

bash /home/lyh/CMCC/run.sh

相关推荐