OpenWRT is added to crontab and started by default.

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.