Friday 22 March 2013

Getting rdiff-backup to work with Window 7 and Cygwin

I think that rdiff-backup has great potential to fulfil my backup needs.  Its only draw back was that I couldn't get it to work.   More specifically, running under Cygwin on Windows 7, the first backup would work just fine, but then the second backup would fail with directory permission errors.  I posted to the rdiff-backup mailing list asking for help and a guy called Dominic Raferd suggested that the problem might be with the Cygwin permissions.  I decided that a needed to run a test to see if he was correct.

First of all I set up my test case.  I made a new "backup-test" directory and populated it with a single file "test.txt".  I then backed up the folder with:

rdiff-backup -v5 /cygdrive/c/backup-test rdiff@localserver::bu/backup-test

Which as expected worked just fine. Without changing anything I repeated the command:

rdiff-backup -v5 /cygdrive/c/backup-test rdiff@localserver::bu/backup-test

This one failed, as expected, with a python stack-trace complaining about file level permissions.

Dominic Raferd suggested that to fix the issue I needed to change the group in Cygwin of the directory I was backing up.  Here's what I applied:

First I checked in /etc/group to find that the id of the Users group was 545. Next I edited /etc/passwd to set my "primary group" to 545. I then started a new Cygwin shell. I ssh'ed onto the backup server and deleted the backup-test directory. I also deleted and recreated the local backup test directory.

With that all in place, I reran the backup line twice. It failed. Same permissions error on the remote files.

Checking the local directory, I noticed that the backup folder had no access permissions set. I made a brand new folder and sure enough it also had no permissions set.

$ ls -ld /cygdrive/c/test
d---------+ 1 dave None 0 Mar 22 22:11 /cygdrive/c/test

With a bit of Googling, stackoverflow gave me my next lead. As they suggest, I edited /etc/fstab and added this at the end:

none /cygdrive cygdrive binary,noacl,posix=0,user 0 0

I restarted Cygwin, cleaned the folders local and remote, and tried the double backup again.  It worked like a charm!




Saturday 16 March 2013

Using netcat to Test if Minetest Server Network is Okay

I'm busy setting up a demo Minetest server for the Madlab Miners session tomorrow.  The server accepts incoming requests over UDP on port 30000.  I wanted to test my DNS and port-forwarding set up.  I found a really simple example on how to do this using netcat on wikipedia.

On the Minetest server, behind my home router, I  ran the server end:

nc -ul -p 3000

I then logged on to my virtual server on the public internet and connected with:

nc -u minetest.mydomain.com 30000


With both terminals open, whatever I typed into the client end appeared in my server window. The networking is sorted!

Minecraft Server Update Time

It's time to update the minecraft server to version 1.5.  Here are the steps.

  1. Log on to the server and stop the running minecraft
  2. Rename the old server file:
    mv minecraft_server.jar minecraft_server.jar.old
  3. Download the latest jar file:
    wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar
  4. Restart the server
  5. Once you are happy it is working you can remove the backed up server jar file

Wednesday 13 March 2013

Minetest

Minetest looks very interesting as a Minecraft alternative.  Here's a very quick comparison.

I'm going to try and get a server up and running for the Madlab Miners session at the Coder Dojo this weekend.

Blogs and Education

#1 son and I went to the Raspberry Pi Jamboree last weekend.  It was collocated with the Education Innovation conference.  We listened to a very inspiring talk about children having their own blogs.  #1 son was sufficiently inspired and now has his own Minecraft related blog.