Code Monkey home page Code Monkey logo

nvram-backup's Introduction

This script will backup specific [NVRAM](http://en.wikipedia.org/wiki/Non-volatile_random-access_memory “NVRAM”) variables and its values, and generates a script that can be used later to restore configurations. It is helpful after an upgrade or in the event of problems.

Basic Requirements

  • Router (MIPSEL) flashed with Tomato Firmware

  • Basic Linux knowledge

  • A network mounted filesystem

  • Tested on AC-66U running latest Shibby build

Configuration

  • Download the nvram-backup script to your desired backup directory (i.e. CIFS, USB, or NFS). I usually mount a CIFS1 or USB where I keep all backup data, logs, and scripts.
  1. Login to your router
  2. Click on Administration then Scripts
  3. Paste the following in the Init tab and click to save
  REMOTE_PATH=<ADD FULL REMOTE PATH WHERE SCRIPT RESIDES>
  LOCAL_PATH=/tmp/nvrambackup
  if [ ! -s "$REMOTE_PATH" ]
    then
    sleep 5
    mkdir $LOCAL_PATH
    cp $REMOTE_PATH/nvram-backup.sh $LOCAL_PATH/nvram-backup.sh
    cp $REMOTE_PATH/nvram-backup.cfg $LOCAL_PATH/nvram-backup.cfg
    chmod a+x $LOCAL_PATH/nvram-backup.sh
  fi
  • Choose the variables you would like to backup and place it on a file called nvram-backup.cfg. You can get a list of all variables and values currently available by ssh’ing to your router and execute the following command:

nvram show

  • Run and verify:

sh /tmp/nvrambackup/nvram-backup.sh

  • Add cronjob to run at 12:00AM on the first of every month:

cru a backup-nvram "0 0 1 * * /tmp/nvrambackup/nvram-backup.sh"

Restore

To restore, run the restore file generated by the main script then reboot the router.

Note: Use at your own risk. Be careful and thoughtful not to brick your router.

nvram-backup's People

Contributors

wbtf avatar

Stargazers

Theodis Butler avatar

Watchers

Wanderley Teixeira avatar Marcel Gabriel Mosoll avatar

Forkers

0delfo0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.