OpenWRT is added to crontab and started by default.
Crond has been added to the OpenWRT system by default, but the number of shards is not configured by default, resulting in service downtime.
Main steps:
1. Modify the startup script/etc/ini. d/cron.
/Etc/rc. d/S50cron:/etc/ini. d/cron Link
#! /Bin/sh/etc/rc. common
# Copyright (C) 2006-2011 OpenWrt.org
START = 50
SERVICE_USE_PID = 1
Start (){
Loglevel = $ (uci_get "system. @ system [0]. cronloglevel ")
[-Z "$ (ls/etc/crontabs/)"] & exit 1
Mkdir-p/var/spool/cron
Ln-s/etc/crontabs/var/spool/cron/2>/dev/null
Service_start/usr/sbin/crond-c/etc/crontabs-l $ {loglevel:-5}
}
Stop (){
Service_stop/usr/sbin/crond
}
2. Add the default startup program/etc/crontabs/root
The file name is username.
Content format: the number is minute. The following is a script for timed running.
*/1 *****/etc/init. d/disconnuser &
*/1 *****/etc/init. d/repuserstatus &
*/6 */etc/init. d/sysupgrade &
*/1 *****/etc/init. d/checkroute
This article permanently updates the link address: