1、安裝 crontabs服務(wù)并設(shè)置開機(jī)自啟:
$ yum install crontabs
$ systemctl enable crond
$ systemctl start crond
2、配置定時(shí)規(guī)則
vim /etc/crontab
在配置文件中配置你的定時(shí)執(zhí)行規(guī)則 每分鐘執(zhí)行
*/1 * * * * /root/app/ngrok.sh > /root/app/test.log 2>&1
3、保存生效
crontab /etc/crontab
4、查看任務(wù)
$ crontab -l