root@localhost \~\]# crontab -e \[root@localhost \~\]# reboot ''' # crontab -e @reboot /path/to/my/program # @reboot 表示重启开机的时候运行一次 @reboot /test/hello.sh ''' ''' 参考: Linux crontab 命令 https://www.runoob.com/linux/linux-comm-crontab.html Run programs at startup via crontab http://www.debianhelp.co.uk/crontab.htm Linux使用crontab出现crontab: installing new crontab https://blog.csdn.net/qq_29417111/article/details/109215477 ''' ''' 其他方法: 在 /etc/rc.d/rc.local 文件中添加启动命令: 可以编辑 /etc/rc.d/rc.local 文件,在文件末尾添加要启动的命令或脚本,这样这些命令或脚本会在系统启动时自动执行。 '''