Category Archive for Linux

Incremental backup script with daily delta

This script enables a ‘Time Machine alike’ backup of folders on a computer to a remote server. The script keeps daily snapshots by saving the deltas compared to the previous backup. The rest of the info is symlinked so you don’t end up using 7 times the required amount of disk space on the server.

I’ve been using this script quite some time to backup my Linux desktop to an NSLU2. I found it back during the spring clean of my archives and save it here for future reference.

#!/bin/sh

# This script does personal backups to a rsync backup server. You will end up
# with a 7 day rotating incremental backup. The incrementals will go
# into subdirectories named after the day of the week, and the current
# full backup goes into a directory called "current"
# Credits: tridge@linuxcare.com

# directory to backup
BDIR_LIST="/home /usr/share/jalbum"

# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=excludes

# the name of the backup machine
BSERVER=hydra

# your password on the backup server
export RSYNC_PASSWORD=<insert_password_here>

########################################################################
# --exclude-from=$EXCLUDES
BACKUPDIR=`date +%A`
OPTS="--force --ignore-errors --delete-excluded
      --delete --backup --backup-dir=$BACKUPDIR -a --exclude-from=$EXCLUDES"

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin

# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
echo "Clearing last weeks incremental directory..."
rsync -vv --delete -a $HOME/emptydir/ backup@$BSERVER::backup/$BACKUPDIR
rmdir $HOME/emptydir

# now the actual transfer
echo "Starting actual backup..."
for BDIR in $BDIR_LIST; do
	rsync -vv $OPTS $BDIR backup@$BSERVER::backup/current
done

echo "Backup completed!"

Making a fresh install of a NSLU2 (SLUG)

OK, it’s time to reinstall my Linksys NSLU2 NAS device (petnamed ‘slug’) to finally put it into ‘production’. This is a list of steps that I have taken, together with some notes that might come in handy if I ever need to do this again.
Read the rest of this entry »

Installing RRDtool with perl bindings on the NSLU

RRDtool is a nifty database mechanism that is widely used for monitoring parameters of routers, switches, weather stations, solar installations, …

I use it to monitor various parameters of our home. Since this is a 24/7 task, I run it on a low-power devic: the NSLU2. This article describes how to install the RRDtools on the NSLU2 (running Unslung).

Read the rest of this entry »

WRT54G and the Dynamic IP services of BNamed.net

BNamed.net offers a dynamic IP service as a part of their domain name registration services.

They offer client software for updating your IP address, but the provided script requires some changes in order to work on your WRT54G(S).

Below, you can a modified script for the Linksys WRT54G that updates your registered IP address when it has changed.

Read the rest of this entry »

NLSU2 overclocking

Well actually, de-underclocking, but that’s not such a fancy title isn’t it :-)

Is seems that Linksys has deliberately underclocked the main processor of the NSLU2.

The people of the unslung project found out that by removing a single resistor from the NSLU2 pcb, you can get to normal (x1) clockspeed. More info.

Read the rest of this entry »

Installing bash on the NSLU2

Installing bash on the NSLU2 seems simple, just run

# ipkg install bash

If you subsequently change the shell type of a user to /bin/bash, you’ll find out that you will not be able to login.

In order for everything to work properly, you also have to create the file

/etc/shells

containing:

/bin/sh
/bin/bash

Read the rest of this entry »

Setting up the NSLU2 as mail server

This information is deprecated. The dovecot mail server is now available as ipkg for installation on your slug.

I leave the information here out of sentiment and who knows, it might come in handy for someone…

As many people, I’ve been running an old PC with a large hard drive as local file and mail server.

When Linksys released their cute little NSLU2, and it became clear that it was possible to load that device with an alternative open firmware, I thought it was time to shut the 8-year old AMD K6 down.

I’ll describe the steps I followed to install an IMAP server with the combination of dovecot, fetchmail, and procmail on the NSLU2.

Read the rest of this entry »