Contact Us

NSIT Support Line
4-TECH (773-834-8324)
support@uchicago.edu
Current Hours

Documentation - Operating Systems

Backing Up Your Account in Unix

Backing up your account is far easier now than it was several years ago. Cheap methods of storing large amounts of information are now available. Zip, Jaz drives, and writable CD-ROMs are examples, and are also available at many of the public labs on campus. You can also download files to a home machine, although this method has its limitations: downloading large files through phone lines can lead to corruption of those files, and can also take a very long time.

Practically speaking, it's easiest to compress your account in some way before downloading it anywhere: this decreases the amount of space that will be taken up on whatever medium you use to store it. This can be best accomplished using utilities available in your Unix account: if you're unfamiliar with Unix, check out our Unix Tutorial.

If you telnet to harper, and type "pwd" (the command that tells you what directory you're in right now) at the harper> prompt, you'll get an answer somewhat like /nfs/harper/h33/yourlogin. If you type "cd .." at that harper> prompt, you'll be moved up one level, to the directory in which your account is based. In a case like that above, this would put you in the /nfs/harper/h33 directory. To compress your account, you would issue a command that may seem cryptic,
"tar cf - yourlogin | gzip > /tmp/yourlogin.tar.gz"

Let's take a look at what the individual parts of this command do.
tar cf - yourlogin

This will use the tar command on your account. Tar takes all the files that make up your directory and wraps them up into a single file: it was originally used to compress directories into a form that could be stored on tape. (Tar stands for "tape archiver.") Tar is still used to put files on tape, but it's also useful for allowing one to compress directories onto other media. The downside to this is that the tar file created by this command is the same size as your account is. (And this might put you over your account quota - but a later section of this command will solve this problem for you, as I will explain shortly.
| gzip

This takes the output of the previous command
tar cf - yourlogin

and gzips it up, so that it only occupies about half the size it did before.
/tmp/yourlogin.tar.gz

This takes the result of the previous two commands
tar -cf yourlogin | gzip

and appends it to a file in the /tmp directory called yourlogin.tar.gz. /tmp is set aside for temporary files, and is cleared every few days. You can put a fairly large file in /tmp on a temporary basis.

At this point, you may be wondering what you do after you've put tarred and gzipped copy of your account in /tmp. That depends on what operating system you're using.

If you're on a Unix machine, simply ftp the file to your machine, then gunzip it and untar it. Voila! Your account is now backed up on your home machine.

If you're on a Macintosh, use MacSFTP. Then, once you've got the file on your Mac, use Stuffit Expander (or a similar program) to expand the file. Voila! Your account is now backed up on your home machine.

If you're on some version of Windows, use SSH SFTP. Then, once you've got the file on your machine, use an archiving program for Windows (such as WinZip) to expand the file. Voila! Your account is now backed up on your home machine.


Return to Unix

Last updated: 10/8/08