Automatic timing execution under Linux, automatic startup script execution

Crontab scheduling settings self-starting and timing execution

1. Installation:

yum install crontabs

2. Crontab service operation instructions:

/sbin/service crond start //启动服务
 
/sbin/service crond stop //关闭服务
 
/sbin/service crond restart //重启服务
 
/sbin/service crond reload //重新载入配置

View crontab service status:

service crond status

Manually start the crontab service:

service crond status

Check whether the crontab service has been set to start at boot, execute the command:

Method one: Start ntsysv on the interface
Method two: Add automatic startup when booting: chkconfig -level 35 crond on
crontab -l to view the list of scheduled tasks

In the linux startup script to create the boot auto-start

Setting the boot method 1
The simplest and rude way is to add your own script directly at the end of the script /etc/rc.d/rc.local (and /etc/rc.local is the same file, soft chain)
and then increase the script execution authority , Execute script permissions.

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

Insert picture description here

Guess you like

Origin blog.csdn.net/tandelin/article/details/106570633