Cron porting and testing under ubuntu are effective_system timing service


Preface

In the case of time running on the linux terminal system, you are worried that there will be a failure. Under normal circumstances, restarting the system can restore the normal working mode. Crontab is a command used to execute programs on a regular basis. The crond command will periodically check whether there is a job to be executed every minute, and if there is a job to be executed, the job will be executed automatically.


Tip: The following is the content of this article, the following cases are for reference

1. Porting and use under Linux terminal

Transplant vixie-cron-4.1 file source file Download

1) Modify the Makefile
gcc and replace it with the cross-compilation tool chain arm-linux-gnueabihf-gcc

2) Copy cron crontab to the /usr/bin directory of the hardware development board

3) Add the startup service file in cat /etc/rc5.d/S90startup (configured according to the actual situation of the board)
cron

4) crontab -e edit information
Insert picture description here
crontal -l view information After
Insert picture description here
adding successfully, restart to take effect.
Note: In case of timing failure, there is no setting in the third step, cron is not started, and the start is relatively early

Two, use under ubuntu

vi /etc/crontab

Add the last line 40 12 * * * root reboot, reboot the device at 12:40 every dayInsert picture description here

#m h dom mon dow user command
40 12 * * * root reboot

Restart the service:
/etc/init.d/cron restart
Insert picture description here

Guess you like

Origin blog.csdn.net/WANGYONGZIXUE/article/details/113982559