Top: Index Previous: Connecting Up: Index Next: Breaking

CSC8306 -- Systems Administration

Backup

Introduction

Backups are one of the most crucial parts of any systems adminstration. Software and hardware goes wrong. Expensive, high-end software and hardware, paradoxicially, goes wrong more frequently than desktop hardware. The important point to remember is that if one of the hard-drives on a machine goes wrong, everyone will blame you. If they lose files, then you'll get blamed for this as well, even if you told them the machine wasn't backed-up.

Even if you are not administering a system for your lab, it's a useful skill to have. Personally, I have a backup script which I run every night. It makes sure that I have a secure copy of all my files and then switches the machine off. As this is unattended, it's no more effort than just switching the machine off directly. Backups need to be easy. If they are a hassle, you will stop doing them regularly, which defeats the point.

An aside — Connecting to the outside world

In the last section, you learned how to use ssh and ssh-agent; well this is great for making computational use of a remote machine, it's less good for interacting with files. So, we need to use a different method.

Now we will try two ways of connecting to linux.cs. First a graphical way.

act
  1. Go to Places->Connect to Server.
  2. Service Type -> "SSH"
  3. Server -> well, see if you can work this out for yourself.
  4. Folder -> Your home space.
  5. User Name -> Again, you should be able to work out what to put in here.

You should get a file explorer to this remote machine now. Try copying some files to the directory. If you wish, you can use ssh as above and see that those files have appeared on the remote machine.

This is nice, BUT you can't run file system commands like ls unless you ssh into the remote machine. Real unix people like command lines. So, how to do this?

logact
  1. Locate and install sshfs. Write down how you did this.
  2. Create a local directory called mnt
  3. We are now going to run this. Try sshfs aXXXXXX@linux.cs: mnt. You don't have to tell sshfs where your home space is; it's the default.
  4. Change into mnt. You should see your files there. You can copy to here, read from here, anything you can do with a local file.

Write short (50 word) answers to the following questions.

log
  1. The file explorer underneath uses sftp rather than ssh. What is sftp? Including a command line showing how you have transferred a file.
  2. What about scp?
  3. sshfs uses fuse to work. What is fuse?
  4. Mostly I use rsync rather than sftp. What does rsync do that sftp or sshfs don't.

Performing Backups

log

  1. Describe what is meant by the term "incremental backup". Describe a suitable scheme for handling disaster recovery on your system
  2. You are required to backup a bioinformatics lab's data (including many complete genomes). What should you consider with regard to backup storage

One of the main tools for performing backups is the tar command. It's a very mature (or very old) piece of software. Its name (Tape ARchive) reflects it's history — very few people backup to tape these days, as tape is generally too slow.

The manual for tar is very good, although rather terse. There are also off-the-shelf backup systems such as backup2l.

logact
  1. Using the tar command, produce a script that conveniently backs up all your important files (and all the files belonging to your users).
  2. How would you list the files that are in stored in your backups, so that you can easily locate the one you want?
  3. Modify the script so that it only backups files modified in the last day.
  4. What commands are required to restore a given file system from the appropriate tar file?

Accessing your backups from Windows

So far you have managed to backup your machines to linux.cs.ncl.ac.uk. This is all very well, but how do you get the files onto your windows machine, should you want to.

Well, the answer is simple; you use an ssh client for windows. There are quite a few of these available. I normally use Cygwin which we will cover in detail later. However, for now, lets try a more graphical client.

act
  1. On windows, go to Start-> Departmental Software -> Computer Science -> Utilities -> Programs.
  2. Select WinSCP.
  3. Fill in the boxes; eventually you will get to a explorer and should be able to work out how to get files to and from linux.cs.

Top: Index Previous: Connecting Up: Index Next: Breaking