NSLU2-Linux
view · edit · print · history

If you are viewing this Howto be warned that it is still a work in progress!

Goal

This will describe a quick and easy way to use the regular Windows utilities to have a regularly scheduled backup of your Windows PC to your NSLU2.

Prerequisites

On your Windows PC you need nothing! On the NSLU2 you will need a lot of disk space and Samba setup to write to that area.

Why this Article?

I used to have a backup routine that pulled the backup from the Windows PC using Samba-tar. But was not very conveinent because I never knew how long the scheduled backup would run so I ended up leaving the Windows PC on all the time. Or someone turned off the Windows PC before the backup was complete! I wanted to find a way to have the Windows machine initiate the backup when it was ready and not let the machine shutdown until complete. I also didn't want to have to install special software to get it to work.

Overview

  1. Get a NSLU2 with one of the Linux distributions
  2. Install and configure Samba
  3. Create the Windows backup batch file
  4. Schedule the job to run at regular intervals

Step 1: Get a NSLU2

Well if you are reading this then I hope you already have one! I can't see that it matters what distribution you are using. I am using DebianSlug for what it's worth.

Step 2: Install and Configure Samba

Go to the relavent Samba setup page.

Step 3: Create a Windows backup batch file

The backup utility I will be using is the Windows Backup Utility. But instead of running it from the GUI we will be using the command line portion. Now stop groaning. The Windows Backup Utility is not that bad. And just because everyone uses the GUI now doesn't mean I can't regress to the DOS batch file days. Its gets the job done, just wait and see.

With every backup routing you will need 2 types of backups. A infrequent FULL backup and a regular INCREMENTAL backup. Create 2 files somewhere that you can refer to them later. It doesn't matter what you call them but I call the first one systemstate.bat and the second one daily.bat

So here are the 2 batch files that I use for each.

The batchfiles do not display properly. Edit the page to copy the properly formated lines

###<systemstate.bat>###

 rem FULL(systemstate) backup

 set BACKUPSERVER=\\NSLU2
 set BACKUPPATH=\mark\Backup
 rem This next line is one complete line
 ntbackup.exe backup systemstate C:\ /j "/-SystemState?" /f "-%date:~10,4%-%date:~4,2%-%date:~7,2%.bkf"
 rem endofline

###</systemstate.bat>###

###<daily.bat>###

 rem INCREMENTAL(Daily) backup

 set BACKUPSERVER=\\NSLU2
 set BACKUPPATH=\mark\Backup
 rem This next line is one complete line
 ntbackup.exe backup C:\ /j "-SystemState?" /m incremental /f "-%date:~10,4%-%date:~4,2%-%date:~7,2%.bkf"
 rem endofline

###</daily.bat>###

Step 4: Schedule the job

With this step you will have to be a bit familiar with the Windows Task Scheduler. I won't go in to great detail but here are the basic steps.

open |Control Panel|Scheduled Tasks|
click on |Add Scheduled Task| and the Wizard opens click |Next| (wait for a few minutes while windows does something...)
Select |Browse| and pick one of the Batch files you created.
For the SystemState? batchfile choose |Monthly|
For the Daily bachfile choose |Daily| (or whatever you want!)
Click on |Next|
Select the appropriate time and other details. click |Next|
Enter the Windows username and password that this Task will run as. |Next|
If you want more details select the |Advanced Properties| box or |Next|

I'll let you worry about the more advanced details regarding running Scheduled Tasks in Windows. But I have had great success with the |Wake computer to run this task| on my PC's.

What's Next

Well the sky's the limit now. With a bit of batch file know-how you can make the script generic enough to store it on the NSLU2 as well. Then all your PC's can point to just the one file.

As far as performance I am able to get about 200MB per minute backup rate with this setup. I'm guessing that the NSLU2 is the slow one here, and particularly Samba. I could do the backup to the local disk and then transfer the backup file with FTP which will be much faster. Since Windows allows you to script FTP transfers (ftp -s) I may see some performance benefits.

Also there was a past limitation on some of the NSLU2's Samba distributions that only allowed files max 2GB. I don't think that Windows Backup can split files so you are out of luck if you see the 2GB limit.

view · edit · print · history · Last edited by mrkzander.
Originally by mrkzander.
Page last modified on July 09, 2007, at 01:46 PM