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 ... 19, 20, 21, 22, 23, 24  Next
Author Message
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 889

PostPosted: Fri Jun 10, 2011 7:27    Post subject: Reply with quote
zoomlink wrote:
I changed the '/opt/usr/sbin/backupessential' script here:


[ -h /opt/restore ] && rm /opt/restore

from: 'ln -s ${TO_MINIMAL} /opt/restore'
to : 'ln -s ${TO_ALL} /opt/restore'


Thanks! Didn't find find the symlink in S00factconfig where I expected it to be
Sponsor
zoomlink
DD-WRT User


Joined: 08 May 2011
Posts: 221

PostPosted: Fri Jun 10, 2011 12:30    Post subject: Reply with quote
I think S00factconfig has a very specific purpose and is a 'post' back-up activity.

I simply uses your backed up variable sets [if you have them as a result of running the backupessential script] when you reset to factory defaults due to a fw upgrade or just because you like to Smile

If you don't have backupessential backup sets, then it simply hard-codes a minimal set of variables so you don't have to go do EVERYTHING from scratch.

Getting all the links related automated restores have to be done on the /opt/usr/sbin/backupessential script.
basmaf
DD-WRT Guru


Joined: 24 Feb 2011
Posts: 1074

PostPosted: Fri Jun 10, 2011 15:03    Post subject: Reply with quote
wabe wrote:
zoomlink wrote:
I changed the '/opt/usr/sbin/backupessential' script here:


[ -h /opt/restore ] && rm /opt/restore

from: 'ln -s ${TO_MINIMAL} /opt/restore'
to : 'ln -s ${TO_ALL} /opt/restore'


Thanks! Didn't find find the symlink in S00factconfig where I expected it to be

You want the fact default script to restore all.sh
Correct me if i'm wrong.

Changing the symlink like zoomlink does not affect the factdefault script

factdefault script is not based on the symlink.
it filters in the /op/var/backup on the last created minimal.sh restore script and creates a var for it.

"lastbackup" this is the file which will be executed.

Its not something i would recommend with a firmware upgrade i would use essential.
If you still want to use all.sh
Code:
lastbackup="`ls -1t /opt/var/backups/*.minimal.sh | head -n1`"

# into

lastbackup="`ls -1t /opt/var/backups/*.all.sh | head -n1`"


BM..
zoomlink
DD-WRT User


Joined: 08 May 2011
Posts: 221

PostPosted: Sat Jun 11, 2011 18:20    Post subject: Reply with quote
basmaf wrote:
wabe wrote:
zoomlink wrote:
I changed the '/opt/usr/sbin/backupessential' script here:


[ -h /opt/restore ] && rm /opt/restore

from: 'ln -s ${TO_MINIMAL} /opt/restore'
to : 'ln -s ${TO_ALL} /opt/restore'


Thanks! Didn't find find the symlink in S00factconfig where I expected it to be

You want the fact default script to restore all.sh
Correct me if i'm wrong.

Changing the symlink like zoomlink does not affect the factdefault script

factdefault script is not based on the symlink.
it filters in the /op/var/backup on the last created minimal.sh restore script and creates a var for it.

"lastbackup" this is the file which will be executed.

Its not something i would recommend with a firmware upgrade i would use essential.
If you still want to use all.sh
Code:
lastbackup="`ls -1t /opt/var/backups/*.minimal.sh | head -n1`"

# into

lastbackup="`ls -1t /opt/var/backups/*.all.sh | head -n1`"


BM..


Yup.. wires got crossed [boy I was batting 100 yesterday].

I was strictly referring to the /opt/usr/sbin/backupessential script that creates a file called /opt/restore that is linked to one of the restore scripts (xxx.minimal.sh by default) unless you change it so that it links to xxx.all.sh or whichever you desire to use when you execute /opt/restore.

The factory default script automates the process, however, as BM indicated needs to be changed to directly call up the xxx.all.sh script.

Franky, I looked back and the S00factconfig was only mentioned after I had mentioned the recommended changes to the backupessential script.

Two different restore approaches.
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Sat Jun 11, 2011 22:12    Post subject: Reply with quote
I personally would not use the all.sh, it is only populated to be able to populate the other files so it includes the dangerous nvram settings. I mean it should be fine on the same router but why take the chance.
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
basmaf
DD-WRT Guru


Joined: 24 Feb 2011
Posts: 1074

PostPosted: Sun Jun 12, 2011 11:28    Post subject: Reply with quote
@ Zoomlink

I was only referring to your change in backupessential.
Cause wabe mentioned it in his reply.


I'm currently working on a modified version of the backupessential script.

I'm changing it to be running as a service.
So it can be started from the services command.
It will also output to syslog
It's backup files are completely the same fraters script.

Will include.
Service start/stop/status/create
Code:

root@DD-WRT:/# service backupessential status
backupessential is started

Cronjob Config = {0 1 * * *}
Cron Info      = {Every day @ 01:00}
Last backup:
MAC= xx:xx:xx:xx:xx:xx Date= 2011/June/12-01:00 | Backup Successful

root@DD-WRT:/#


Info file creation for each backup
Code:
root@DD-WRT:/# cat /opt/var/backups/2011/June/01/{mac_add}.info

################################################
#01:00

WAN MAC                 =
Router Name             = DD-WRT
Router Model            = Linksys E4200

Firmware Release and Build info:
DD-WRT v24-sp2 big (c) 2011 NewMedia-NET GmbH
Release: 05/17/11 (SVN revision: 17084)
Enhanced with OTRW

Backups created:
{mac_add}_20110601_01:00.all.sh
{mac_add}_20110601_01:00.dangerous.sh
{mac_add}_20110601_01:00.essential.sh
{mac_add}_20110601_01:00.minimal.sh
{mac_add}_20110601_01:00.preferred.sh
root@DD-WRT:/#


Have to test a couple of small modifications.

If someone is interested i can post it.

BM..
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 889

PostPosted: Sun Jun 12, 2011 18:59    Post subject: Reply with quote
Dark_Shadow wrote:
I personally would not use the all.sh, ....

I agree - I decided on using the "essential" file and modified both "backupessential" and "S00factconfig" to reflect this choice.
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Sun Jun 12, 2011 19:41    Post subject: Reply with quote
basmaf wrote:


Have to test a couple of small modifications.

If someone is interested i can post it.

BM..
Sure, I'll give it a go.
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
basmaf
DD-WRT Guru


Joined: 24 Feb 2011
Posts: 1074

PostPosted: Mon Jun 13, 2011 8:36    Post subject: Reply with quote
Dark_Shadow wrote:
I'll give it a go.


Ok Cool

copy S99backupessential to /opt/etc/init.d

By default it will shedule a cronjob each night @ 01:00
Folder structure is created like /opt/var/backups/2011/06.June/13/
If you prefer all files within on folder.

Edit User settings:
Code:
#########################################################
####  User settings
 
# CRONjob   = Backup interval Read WIKI for more info
# CRONinfo   = Is only "info" shown @ start/status modify when changing CRONjob for your own info
CRONjob="0 1 * * *"
CRONinfo="Every day @ 01:00"
 
## FTP
# Change to FTP_ON=1 to enable ftp
# FTP Login information change to your information
FTP_ON=0
FTPS=ftp://192.168.10.210/backups
USERPASS=user:pass

BU_DAY="`date +%Y/%m.%B/%d`"                     # 2011/01.Jan/30

# Folders are created like "2011/01.Jan/01/"
# Uncomment FOLDER and comment next FOLDER to create all backups in one folder
#FOLDER=/opt/var/backups/
FOLDER=/opt/var/backups/${BU_DAY}/

####  User settings
#########################################################


Attached CLI output for options
on | ? | start | create | status

Intentionally deleted the vars_to_*
Included download function if vars_to_* are missing.

Let me know what you think
I'm always in for improvements.

BM..



S99backupessential_V1.1.tar.bz2
 Description:
Added PPP to vars_minimal.

Download
 Filename:  S99backupessential_V1.1.tar.bz2
 Filesize:  4.13 KB
 Downloaded:  1034 Time(s)


CLI_Output.txt
 Description:

Download
 Filename:  CLI_Output.txt
 Filesize:  1.94 KB
 Downloaded:  914 Time(s)



Last edited by basmaf on Mon Jun 13, 2011 12:55; edited 2 times in total
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Mon Jun 13, 2011 10:42    Post subject: Reply with quote
I haven't tried it yet, but the first thing i see right off is I think pppoe settings should be part of minimal for those of us who have pppoe.
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
basmaf
DD-WRT Guru


Joined: 24 Feb 2011
Posts: 1074

PostPosted: Mon Jun 13, 2011 10:56    Post subject: Reply with quote
Haven't changed the backup procedure.
Its direct copy from fraters script.

I'm not using pppoe and have no experience with its settings.
adding some values to it is small effort.

Edit:
Checked vars_preffered, that contains ^ppp
Will contain all pppoe values. its not by default in the minimal file on fraters servers.

Will do add small procedure to check if its in the file and otherwise add it.

Edit 2:

Uploaded new version.
^ppp by default included if vars_minimal not present
or
^ppp will be added to existing vars_minimal
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 889

PostPosted: Mon Jun 13, 2011 21:37    Post subject: Reply with quote
wabe wrote:

I'll make a new test later on to see if editing Fraters S00factconfig file to point to the essential script instead of the minimal help and do and "nvram erase" & reboot.

Changing the script to restore from "essential" works fine. Cannot understand why running the essential/all scripts doesn't work unless nvram is erased beforehand. Can anyone explain this??
zoomlink
DD-WRT User


Joined: 08 May 2011
Posts: 221

PostPosted: Mon Jun 13, 2011 22:19    Post subject: Reply with quote
When in the S00factdefault script do you do an nvram erase, I imagine before you write the new variables no? or after you write and commit?
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Mon Jun 13, 2011 23:01    Post subject: Reply with quote
basmaf wrote:
Haven't changed the backup procedure.
Its direct copy from fraters script.

I'm not using pppoe and have no experience with its settings.
adding some values to it is small effort.

Edit:
Checked vars_preffered, that contains ^ppp
Will contain all pppoe values. its not by default in the minimal file on fraters servers.

Will do add small procedure to check if its in the file and otherwise add it.

Edit 2:

Uploaded new version.
^ppp by default included if vars_minimal not present
or
^ppp will be added to existing vars_minimal


I am running your mod right now. noticed that it will break S00factdefault service because the path has chaged to the last backup.

EDIT: Maybe a copy of the last backup or symlink can be added to /opt/var/backups/ to preserve that servece.

Other than that it seems to work. Not sure if I like the dated dir. who knows maybe it will grow on me.

EDIT2: /opt/restore/ is not created with OTRW, maybe a check here and create if doesn't exist. The path in S00factdefault can be modified to point to /opt/restore/

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 889

PostPosted: Tue Jun 14, 2011 4:44    Post subject: Reply with quote
[quote="zoomlink"]When in the S00factdefault script do you do an nvram erase, I imagine before you write the new variables no? or after you write and commit?[/quote
The factdefault service script checks if router ip is 192.168.1.1 & ssid is "dd-wrt" at startup. If this condition is met the last backup is restored and router is rebooted.
The default is to restored the minimal backup but I've changed this to essential which restore all necessary settings
Goto page Previous  1, 2, 3 ... 19, 20, 21, 22, 23, 24  Next Display posts from previous:    Page 20 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