Retrieving files from snapshots

The information in this document relies heavily on a little knowledge of certain Linux commands- notably cp, ls, and cd. You may want to familiarize yourself with the use of these commands before you try to follow these steps. Documentation for all of these commands exists in the form of 'man pages,' which can be viewed on our shell server. To view the man pages, telnet to and type:

man (command name- cp, cd, etc.)

Snapshots- backups of our users home, web and ftp directories- are taken nightly and hourly. To retrieve files from these snapshots (backups) you simply copy them from their .snapshot directories into the appropriate directory.

(Note: Syntax is very important- please be aware that the snapshot directories are actually 'dot' directories- which is to say, a dot (.) must precede the word snapshot! ".snapshot" is correct; just "snapshot" is not.)

The .snapshot directories are not visible when you use the ls command, but they are there!

The .snapshot directories are accessible from any directory you would normally be working with:


As an example, here is how you find the backups of your web directory. We will use the imaginary account name 'auser' to demonstrate- just substitute your username for 'auser.'

1. Telnet to

2. cd to your web directory, and then cd to the directory .snapshot, like this:

cd /home/WWW_pages/auser/.snapshot

3. If you view the contents of this directory using ls, you will see four subdirectories:

hourly.0 hourly.1 nightly.0 nightly.1

Hourly.0 contains a snapshot of your web directory that was taken at the top of the last hour- in other words, it is 1 hour old. After an hour passes, that directory is renamed hourly.1, and a new snapshot directory is made and named hourly.0. So there is always a snapshot that is 1 hour old and one that is 2 hours old.

The nightly snapshots follow the same pattern- nightly.0 was created last midnight and nightly.1 was created on the previous midnight.

4. Choose which snapshot directory you would like your backups to come from and cd into it:

cd hourly.0 (or whatever)

5. The command ls -la will show you everything that was in your directory when the snapshot was made.

6. use the command cp to copy individual files from one location to another. You will need to specify what file you are copying and where you want to put it. In our example, 'auser' is in his hourly.0 directory and he is trying to copy his index.html back into his web directory. Here is what he would need to do:

cp index.html /home/WWW_pages/auser

For clarity's sake, lete's review the syntax:

cp (the command) index.html (the file to be operated upon) /home/WWW_pages/auser (the destination)

This will copy the index.html file into his web directory- unless there is already a file there called index.html. If you are trying to restore a file from a snapshot, and a file with that name already exists in the target directory, you will need to rename or delete that file first!

7. You can also use the cp command to copy whole directories if you use the -r flag:

cp -r somedirectory/ /home/WWW_pages/auser/

this command will move the entire contents of the 'somedirectory' directory into /home/WWW_pages/auser (as above, this will not work if there is already a directory with that name in the target directory).

There are .snapshot directories that correspond to all of our user's directories. For instance, if you wish to find backup copies of files that were in your home directory, simply cd from your home dorectory to .snapshot and then follow the same procedure outlined in the examples given above.

This is only a basic introduction to using your .snapshot files. There is more that can be done with these techniques with a little study- again, we recommend that you use the man pages for further instructions. Remember to be careful!