Results 1 to 7 of 7

Thread: Full backup of NVRAM, settings, configuration

  1. #1

    Full backup of NVRAM, settings, configuration

    Hi,

    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 1.9.2.7-10). 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,
    Seff
    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)


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

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

    Code:
    #!/bin/sh
    # backup volatile data from router to the flash card
    
    PATH=${prefix}/sbin:${prefix}/bin:/sbin:/bin:/usr/sbin:/usr/bin
    BACKUP_PATH=/tmp/harddisk/data/backup
    
    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
    Location
    the netherlands
    Posts
    155
    just my curiosity. Why a weekly backup? Do you change settings regularly?

    cheers,

    Wiz

  5. #5
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    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:
    Code:
    #! /bin/sh
    cat /opt/tmp/save/fs/last/nvram.txt | awk -F'=' '{print "nvram set " $1 "='\''" $2 "'\''"}' | sh
    nvram commit

  6. #6
    Lovely!

    I will update my script with:

    Code:
    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
    Location
    Moscow, Russia
    Posts
    3,805
    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 http://code.google.com/p/wl500g/issu...mmary%20Opened

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

    My second solution from this post: http://wl500g.info/showpost.php?p=136554&postcount=5 works fine

Similar Threads

  1. - 1.9.2.7-10
    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
  •