Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Creating a CRON job..

Discussion in 'Asuswrt-Merlin' started by muffintastic, Oct 11, 2017.

  1. muffintastic

    muffintastic Regular Contributor

    Joined:
    Nov 3, 2015
    Messages:
    62
    I would like to use this code, every 2 hours:

    Code:
    for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done
    I would like it survive a reboot as such also, could someone help me achieve this? #noob
     
  2. JDB

    JDB Regular Contributor

    Joined:
    Aug 28, 2016
    Messages:
    145
  3. muffintastic

    muffintastic Regular Contributor

    Joined:
    Nov 3, 2015
    Messages:
    62
  4. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    3,713
    Location:
    UK
    I doubt whether running that code every 2 hours would be that useful. The "empty" NVRAM variables will be created during the routers boot up sequence, not later on whilst it is running. So to me it would seem more logical to put the code in a services-start script instead.
     
  5. JDB

    JDB Regular Contributor

    Joined:
    Aug 28, 2016
    Messages:
    145
    You have the code.
    Just type cru as it suggests and it has some guidance.


    Sent from my iPhone using Tapatalk
     

Share This Page