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!"

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).

Continue reading Installing RRDtool with perl bindings on the NSLU

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.

Continue reading WRT54G and the Dynamic IP services of BNamed.net

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

Continue reading Installing bash on the NSLU2

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.

Continue reading Setting up the NSLU2 as mail server