Backup settings and restore them to even different hardware.

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 16, 17, 18 ... 22, 23, 24  Next
Author Message
Slione
DD-WRT User


Joined: 05 Dec 2007
Posts: 215
Location: Michigan

PostPosted: Sat Oct 09, 2010 15:29    Post subject: Reply with quote
barryware wrote:
Slione wrote:

A couple of questions though: 1) Has anybody restored their setting with this and 2)when I run the above command I get a file named settings. What command to restore it?

Thanks.


Good questions.. I ran the command and just saved settings to /tmp. Copied it tomy pc to have a look at it.

Looks a bit binary to me when looking at it with notepad++. There are no "write" commands like fraters backup. This is not a file that can be executed so indeed.. we need some direction.


I think I figured it out. I did the backup on my 600N, then loaded the latest BS version on it. I copied the settings file back to the root directory then ran:

nvram restore ~/settings

It loaded them within a few seconds, I then rebooted the router (all the while crossing my fingers, toes and drank a couple of beers) and it cam back up! I checked all of my setting and they are in there. Very fast to restore.

_________________
WRT1900AC v1-build r30731
Sponsor
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sat Oct 09, 2010 15:42    Post subject: Reply with quote
Slione wrote:
barryware wrote:
Slione wrote:

A couple of questions though: 1) Has anybody restored their setting with this and 2)when I run the above command I get a file named settings. What command to restore it?

Thanks.


Good questions.. I ran the command and just saved settings to /tmp. Copied it tomy pc to have a look at it.

Looks a bit binary to me when looking at it with notepad++. There are no "write" commands like fraters backup. This is not a file that can be executed so indeed.. we need some direction.


I think I figured it out. I did the backup on my 600N, then loaded the latest BS version on it. I copied the settings file back to the root directory then ran:

nvram restore ~/settings

It loaded them within a few seconds, I then rebooted the router (all the while crossing my fingers, toes and drank a couple of beers) and it cam back up! I checked all of my setting and they are in there. Very fast to restore.


Good show.. Gotta hand it to you though speriment'n with a 600 Smile

I would still like to know more about it though..

Can it be used on diff hardware? It would be great if you could save & restore the file from the pc, etc.

Maybe a step by step Razz

_________________
[Moderator Deleted] Shocked
Slione
DD-WRT User


Joined: 05 Dec 2007
Posts: 215
Location: Michigan

PostPosted: Sat Oct 09, 2010 16:33    Post subject: Reply with quote
barryware wrote:

Good show.. Gotta hand it to you though speriment'n with a 600 Smile


That's why I drank the beers Laughing

Your other questions about using the settings on other units is one I'd like to know also. Hopefully someone with a lot more knowledge of it can give us some direction.

_________________
WRT1900AC v1-build r30731
crashfly
DD-WRT Guru


Joined: 24 Feb 2009
Posts: 2026
Location: Sol System > Earth > USA > Arkansas

PostPosted: Sun Oct 10, 2010 3:29    Post subject: Reply with quote
Until those questions are answered, I will continue to use the backup script from "OTRW". This new way might be faster, but as it is a new feature, I really do not want to screw up my router.
_________________
E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]

Try Dropbox for syncing files - get 2.5gb online for free by signing up.

Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
kingsmill
DD-WRT User


Joined: 20 May 2008
Posts: 79

PostPosted: Thu Oct 21, 2010 11:00    Post subject: Reply with quote
I have the latest version of MyPage installed which contains Fraters nvram backup utility. When I select a "Backup NVRAM TXT" the resulting file is returning the wrong output for rc_startup and rc_firewall.

nvram contains the following:-

Quote:
root@router# nvram get rc_startup
# get date
date
# get current directory
pwd
root@router#



Status, My Page, NVRAM, Backup NVRAM TXT, returns the following:-

Quote:
nvram set # get current directory"
nvram set rc_startup="# get date"
nvram set pwd"
nvram set rc_startup="# get date"


Does MyPage contain the latest backup script? I am running mypage_V0.16.4-20101020.tgz. How do I know if this contains the very latest version of backup script? Where can I get the latest version of the backup script from?

Thanks,
Geoff..
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Nov 20, 2010 10:42    Post subject: Reply with quote
I have updated the script once more....
I added the flavour 'minimal' and some code that will delete the last saved config if it's (about) the same as the current one.
I think it may help in keeping things organized....

I have also written a script that will automatically restore the settings after a factory reset. It's not yet sturdy enough for publishing and it has a problem I can't fix in optware....

/opt is not mounted after a factory reset, so I need to mount it first

Code:
wget -O /opt/usr/sbin/backupessential http://wd.mirmana.com/backupessential

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
kingsmill
DD-WRT User


Joined: 20 May 2008
Posts: 79

PostPosted: Sat Nov 20, 2010 21:27    Post subject: Reply with quote
Frater,

Thanks for such a great script. I just copied down the latest version of backupessential and have a couple of suggestions and comments.

1/ The filename retrieved by wget is backupessential. The examples in this file call it backupvars. It would be good to refer to this script by a common name.

2/ Any chance of adding how to get the latest version of this script at the header of the file.

wget -O /opt/usr/sbin/backupessential http://wd.mirmana.com/backupessential
wget -O /opt/usr/sbin/vars_to_skip http://wd.mirmana.com/vars_to_skip
wget -O /opt/usr/sbin/vars_to_include http://wd.mirmana.com/vars_to_include
wget -O /opt/usr/sbin/vars_preferred http://wd.mirmana.com/vars_preferred

Alternative, how about backupessential create these files if they do not exist as is done with vars_minimal?

3/ The comments at the head of the script state that the TRANSFER default is off but is actually on. The default being off makes more sense to me since there is a “-t” switch to enable transfer.

4/ vars_to_include is required but not listed as a script requirement at the top of the file.

5/ It would be good if this script would work without needing optware. Without optware you get a number of “ls –f” option invalid errors from the following lines.

NUMFILES=`ls -1ft ${MAC}.*.${flavour}.sh | wc -l`
PREVIOUS=`ls -1frt ${MAC}.*.${flavour}.sh | tail -n2 | head -n1`

Can the –f switch be dropped?

Thanks,
Geoff..
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Nov 21, 2010 7:59    Post subject: Reply with quote
kingsmill wrote:
Frater,

Thanks for such a great script. I just copied down the latest version of backupessential and have a couple of suggestions and comments.

1/ The filename retrieved by wget is backupessential. The examples in this file call it backupvars. It would be good to refer to this script by a common name.
changed
kingsmill wrote:

2/ Any chance of adding how to get the latest version of this script at the header of the file.

wget -O /opt/usr/sbin/backupessential http://wd.mirmana.com/backupessential
wget -O /opt/usr/sbin/vars_to_skip http://wd.mirmana.com/vars_to_skip
wget -O /opt/usr/sbin/vars_to_include http://wd.mirmana.com/vars_to_include
wget -O /opt/usr/sbin/vars_preferred http://wd.mirmana.com/vars_preferred
added
kingsmill wrote:

Alternative, how about backupessential create these files if they do not exist as is done with vars_minimal?
I just did it for minimal because it was an addition, let's leave it
kingsmill wrote:

3/ The comments at the head of the script state that the TRANSFER default is off but is actually on. The default being off makes more sense to me since there is a “-t” switch to enable transfer.
fixed
kingsmill wrote:


4/ vars_to_include is required but not listed as a script requirement at the top of the file.
changed
kingsmill wrote:

5/ It would be good if this script would work without needing optware. Without optware you get a number of “ls –f” option invalid errors from the following lines.

NUMFILES=`ls -1ft ${MAC}.*.${flavour}.sh | wc -l`
PREVIOUS=`ls -1frt ${MAC}.*.${flavour}.sh | tail -n2 | head -n1`

Can the –f switch be dropped?

Thanks,
Geoff..
fixed
I replaced -f with --color=never. So it will now work for good ol' busybox as well

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
kingsmill
DD-WRT User


Joined: 20 May 2008
Posts: 79

PostPosted: Sun Nov 21, 2010 8:54    Post subject: Reply with quote
Frater,

Thanks so much for the updates. backupessential now works fine on systems that do not have optware installed.

Geoff..
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Nov 21, 2010 11:30    Post subject: Reply with quote
I have a 'cleardups' that will remove duplicate backups for you. experimental, but works..
I just wrote it to get rid of some backups I have.
Are you using it as a nightly cronjob too?

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
kingsmill
DD-WRT User


Joined: 20 May 2008
Posts: 79

PostPosted: Mon Nov 22, 2010 11:48    Post subject: Reply with quote
Frater,

I am actually using it to manually backup nvram when I make changes. My networks are not that dynamic so I don't really need to do a backup on a daily basis.

Thanks for your support with backupessential.

Geoff..
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Tue Nov 23, 2010 7:39    Post subject: Reply with quote
I seem to have forgotten a few crucial nvram variables for minimal in the new script.
Redownload it and remove /opt/usr/sbin/vars_minimal so it can recreate that file.

Added variables:
Code:

wshaper_uplink
wshaper_enable
wshaper_downlink
wshaper_dev
wl_nband
wan_wins
sshd_enable
remote_mgt_ssh
remote_management
local_dns
lan_ipaddr
lan_domain
https_enable
http_enable
fullswitch
forward_port
enable_jffs2
dns_dnsmasq
dmz_ipaddr
dmz_enable


I have already a script that will automatically recover the settings after a factory reset.

Because this script does not start when USB is disabled it's not fully automatic.

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
kingsmill
DD-WRT User


Joined: 20 May 2008
Posts: 79

PostPosted: Tue Nov 23, 2010 9:07    Post subject: Reply with quote
Frater,

Unfortunately the diff command only exists when optware is installed. If you could compare the files using md5sum, which is a standard command within dd-wrt, then backupessential can still run without the need for optware.

Thanks,
Geoff..
sterlinggold
DD-WRT Novice


Joined: 24 Dec 2010
Posts: 1

PostPosted: Fri Dec 24, 2010 3:30    Post subject: Reply with quote
Wanted to report an issue I noticed with "nvram set static_leases=" script output. Its missing an = sign after the IP address resulting in corrupt static lease fields.
This is based on the version I got from wd.mirmana.com/backupessential today 12/23/2010

output is:
"nvram set static_leases=00:00:00:00:00:00=box1=192.168.1.100 00:15:00:00:00:00=box2=192.168.1.101 "
needs to be:
"nvram set static_leases=00:00:00:00:00:00=box1=192.168.1.100= 00:15:00:00:00:00=box2=192.168.1.101=

SG

frater wrote:
kingsmill wrote:
Frater,

Thanks for such a great script. I just copied down the latest version of backupessential and have a couple of suggestions and comments.

1/ The filename retrieved by wget is backupessential. The examples in this file call it backupvars. It would be good to refer to this script by a common name.
changed
kingsmill wrote:

2/ Any chance of adding how to get the latest version of this script at the header of the file.

wget -O /opt/usr/sbin/backupessential http://wd.mirmana.com/backupessential
wget -O /opt/usr/sbin/vars_to_skip http://wd.mirmana.com/vars_to_skip
wget -O /opt/usr/sbin/vars_to_include http://wd.mirmana.com/vars_to_include
wget -O /opt/usr/sbin/vars_preferred http://wd.mirmana.com/vars_preferred
added
kingsmill wrote:

Alternative, how about backupessential create these files if they do not exist as is done with vars_minimal?
I just did it for minimal because it was an addition, let's leave it
kingsmill wrote:

3/ The comments at the head of the script state that the TRANSFER default is off but is actually on. The default being off makes more sense to me since there is a “-t” switch to enable transfer.
fixed
kingsmill wrote:


4/ vars_to_include is required but not listed as a script requirement at the top of the file.
changed
kingsmill wrote:

5/ It would be good if this script would work without needing optware. Without optware you get a number of “ls –f” option invalid errors from the following lines.

NUMFILES=`ls -1ft ${MAC}.*.${flavour}.sh | wc -l`
PREVIOUS=`ls -1frt ${MAC}.*.${flavour}.sh | tail -n2 | head -n1`

Can the –f switch be dropped?

Thanks,
Geoff..
fixed
I replaced -f with --color=never. So it will now work for good ol' busybox as well
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Fri Dec 24, 2010 6:08    Post subject: Reply with quote
sterlinggold wrote:
Wanted to report an issue I noticed with "nvram set static_leases=" script output. Its missing an = sign after the IP address resulting in corrupt static lease fields.

I just checked my backups and I can confirm that equal sign is missing.

I haven't noticed any negative effects as my static leases in nvram does contain that equal sign. Somewhere in this weekend I will have time to look into it.

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Goto page Previous  1, 2, 3 ... 16, 17, 18 ... 22, 23, 24  Next Display posts from previous:    Page 17 of 24
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum