Results 1 to 7 of 7

Thread: Full backup of NVRAM, settings, configuration

  1. #1

    Full backup of NVRAM, settings, configuration


    I was searching the forum to answer a simple question. How do I take and automate a full backup of my WL-500gx? It happened to my a few times, that I had a power outage and my system reverted back to the default flashed firmware (Oleg's This means that all configuration settings using flashfs save were lost. Of course, my USB memory stick was intact.

    Using the GUI, there are two steps to backup the device:

    1. System Setup/Flashfs Management/Save As...
    2. System Setup/Setting Management/Save As...

    Using CLI, there should be two corresponding steps as well:

    1. Run flashfs save and cp /tmp/flash.tar.gz /tmp/harddisk
    2. Create and copy all settings. But how to create and I copy the settings as in GUI? Any idea?

    I would like to use cron and backup all my configuration to the USB memory stick once a week automatically...

    Thank you,
    Last edited by seff; 19-09-2008 at 09:39.

  2. #2

    Thumbs up Automatic backup

    I figured it out myself. The configuration (that can be loaded back) is simply a list of lines in NVRAM with a header:

    echo "HDR1 , " > /opt/backup/WL500g.Deluxe.CFG
    nvram show >> /opt/backup/WL500g.Deluxe.CFG
    flashfs save && flashfs commit
    cp /tmp/flash.tar.gz /opt/backup/WL500g.Deluxe.tar.gz

    Perphaps flashfs commit is not needed...
    And lines should be separated by spaces... (I will work on it and post it here when finished)

    Last edited by seff; 26-09-2008 at 15:16.

  3. #3
    I have made it as part of a weekly cron job script:

    # backup volatile data from router to the flash card
    echo "HDR1 , " > $BACKUP_PATH/WL500g.Deluxe.CFG
    nvram show >> $BACKUP_PATH/WL500g.Deluxe.CFG
    gzip $BACKUP_PATH/WL500g.Deluxe.CFG
    flashfs save
    cp /tmp/flash.tar.gz $BACKUP_PATH
    # atomic operations
    mv $BACKUP_PATH/WL500g.Deluxe.CFG.gz $BACKUP_PATH/`date +%y%m%d`.WL500g.Deluxe.CFG.gz
    mv $BACKUP_PATH/flash.tar.gz $BACKUP_PATH/`date +%y%m%d`.flash.tar.gz

  4. #4
    Join Date
    Dec 2004
    the netherlands
    just my curiosity. Why a weekly backup? Do you change settings regularly?



  5. #5
    Join Date
    Feb 2007
    Moscow, Russia
    you can use undocumented
    PHP Code:
    nvram save filename
    nvram restore filename 
    this is the way how nvram is stored in web-interface. I think it is more safe way than your approach.

    I'm using a bit different approach --- saving of 'nvram show' output and such nvram_restore script:
    #! /bin/sh
    cat /opt/tmp/save/fs/last/nvram.txt | awk -F'=' '{print "nvram set " $1 "='\''" $2 "'\''"}' | sh
    nvram commit

  6. #6

    I will update my script with:

    nvram save filename
    I run weekly backups because I have peace of mind. My wl500gx was reset twice when I mistakenly unplugged the A/C adapter. It's probably a manufacturing defect with these older wl500g Deluxe devices. Comparing for changes in nvram is good too, I am too lazy to script it

  7. #7
    Join Date
    Feb 2007
    Moscow, Russia
    For those, who would like to attempt to restore the configuration saved from the web interface, or by nvram restore, I'd recommend to take into account the following

    This issue equally affects users of Oleg's, lly's, and all known up to date asus firmwares (1.9.*,,

    My second solution from this post: works fine

Similar Threads

  1. -
    By Oleg in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 456
    Last Post: 02-11-2009, 19:31
  2. Full server config: Samba ftp http xmail mysql forum motor
    By KisVuK in forum WL-500gP Tutorials
    Replies: 14
    Last Post: 15-12-2008, 21:34
  3. Restore to factory defaults (NVRAM Settings)
    By schigndix in forum WL-500gP Q&A
    Replies: 0
    Last Post: 08-10-2006, 14:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts