「 LINUX篇 」 四月 27, 2022
Crontab @reboot 设置开机启动命令
文章字数 607 阅读约需 1 mins.
有时服务器断电后再开机启动需要启动一些服务,除了正常的 rc 命令可以实现外,之前我常用的是 systemctl service, 今天发现 crontab 的 reboot 标签也可以实现
crontab -e
# 启动后 120 秒启动 canal adapter
@reboot sleep 120; cd /data/msmp-service/canal/canal.adapter-1.1.5/bin && sh restart.sh
@reboot sleep 600...
查看全文