Automatic daily backup

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
rajbps
DD-WRT Novice


Joined: 12 Mar 2011
Posts: 2

PostPosted: Thu Sep 12, 2013 21:12    Post subject: Automatic daily backup Reply with quote
Hi Team,

I am looking to see if its possible to create a script/batch file that will run on windows and connect to a wrt54g running dd wrt to back up the configuration on a daily basis. This is the file with all the settings.

can anyone please help.

Cheers,

raj
Sponsor
unlucky1
DD-WRT User


Joined: 09 Mar 2013
Posts: 75

PostPosted: Sat Sep 14, 2013 1:59    Post subject: Reply with quote
This is an old thread that Broadcom users came up with. Not sure if it's still valid or not. If you read through the whole thing (I did) there are modifications for Windows. If you're any good with DD-WRT coding, you might see what you can do with it.

http://www.dd-wrt.com/phpBB2/viewtopic.php?t=44324&postdays=0&postorder=asc&start=0

If you try it and it does work, let me know, especially if you're using an Atheros type router. I'd like to use it.

_________________
TP-Link TL-WDR4300 v1 (NAS) - r54682
Buffalo WZR-600DHP (Gateway, NAS, DDNS, DHCP) - r54682
Netgear R7800 (Gateway, DDNS, DHCP, DNSMASQ w/Pi Hole) - r54682
Netgear R7800 (AP) - r54682
beardymarrow
DD-WRT Novice


Joined: 04 Jan 2018
Posts: 2

PostPosted: Thu Jan 04, 2018 15:24    Post subject: Reply with quote
Hi,
I realise this is a mega necro-bump, but I've created a Powershell script for my own use that works great when called from a number of scheduled tasks (one per ddwrt router I support), so thought I'd share it. You never know, someone might find this thread in another 4 years and find it useful Smile

Powershell script - Create a text file called "PowerShell Script.ps1", for example (the .ps1 extension is important).
Code:
param (
    [Parameter(Mandatory=$true)][string]$IPAddress,
   [Parameter(Mandatory=$true)][string]$Hostname
)

$storageDir = "C:\Users\username\Documents\Network Docs and Backups\My Home Network\Backups"
$Username = "admin"
$Password = "passwordhere"

$Date = (Get-Date).ToString("yyyy_MM_dd_HH_mm_ss")
$url = "http://$IPAddress/nvrambak.bin"
$file = "$storageDir\nvrambak_$Hostname" + "_" + "$Date.bin"
$webclient = New-Object System.Net.WebClient
$credCache = new-object System.Net.CredentialCache
$creds = new-object System.Net.NetworkCredential($Username,$Password)
$credCache.Add($url, "Basic", $creds)
$webclient.Credentials = $credCache
$webclient.DownloadFile($url,$file)


Then create as many scheduled tasks as you have devices.
Action - Start a program
Program/script - PowerShell.exe
Arguments - -ExecutionPolicy Bypass -file "C:\Users\username\Documents\Network Docs and Backups\My Home Network\Backups\PowerShell Script.ps1" -IPAddress IP.IP.IP.IP -Hostname Hostnamehere

I now have a load of files in C:\Users\username\Documents\Network Docs and Backups\My Home Network\Backups called (for example "nvrambak_Hostnamehere_2018_01_04_00_00_05.bin"
robjak
DD-WRT Novice


Joined: 10 Dec 2017
Posts: 22

PostPosted: Fri Jan 05, 2018 18:06    Post subject: Reply with quote
thank you
d0ug and beardymarrow
greenhost
DD-WRT Novice


Joined: 20 Jun 2016
Posts: 7

PostPosted: Tue Nov 29, 2022 2:53    Post subject: Reply with quote
beardymarrow wrote:
Hi,
I realise this is a mega necro-bump, but I've created a Powershell script for my own use that works great when called from a number of scheduled tasks (one per ddwrt router I support), so thought I'd share it. You never know, someone might find this thread in another 4 years and find it useful Smile

I now have a load of files in C:\Users\username\Documents\Network Docs and Backups\My Home Network\Backups called (for example "nvrambak_Hostnamehere_2018_01_04_00_00_05.bin"


well, today after 4yrs, coincidentally, I found this!! Surprised

also would like to make a small correction, in line number 12, to adjust the filename extra character, '\'.

12:
Code:
$file = "$storageDir"+"nvrambak_$Hostname" + "_" + "$Date.bin"


Everything else works like a charm! Very Happy
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Tue Nov 29, 2022 12:36    Post subject: Reply with quote
beardymarrow wrote:
Hi,
I realise this is a mega necro-bump, but I've created a Powershell script for my own use that works great when called from a number of scheduled tasks (one per ddwrt router I support), so thought I'd share it. You never know, someone might find this thread in another 4 years and find it useful Smile

Maybe send a copy of this post to:

DD-WRT :: View Forum - Contributions Upload
https://forum.dd-wrt.com/phpBB2/viewforum.php?f=11

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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