Retrieving old versions of files

What happens when you accidentally delete a file? Or you have decided that your old code worked better than the version you are looking at now? Hopefully you never run into such problems; but if not, you might take advantage of the archives that we run each morning around 4:00 am.

Early each morning, the server archives a version of your home directory, not including your Web space. Generally speaking, we save old versions for 30 days before discarding them. Note: While the process seems to work, it is not guaranteed to always work. Moreover, we may need to save disk space by reducing the number of versions stored, or exclude very large files (of several megabytes or more - generally these are files downloaded from the Internet). If you lose your data, and the archival process failed for some reason, you are responsible.

You have the ability to access old versions of files that you create.

  1. First you need to access Grendel, the server where the archived versions are stored. To do this, log into any of the Linux computers, open up the terminal and enter:
    ssh grendel
    After typing the password, any subsequent commands you enter will then be executed and displayed on Grendel. (The interface for accessing the archive depends heavily on the Linux command line. If you are not familiar with it, you can learn now.)

  2. Once logged into Grendel, navigate to the directory containing the file in question using cd. (If you've deleted the file, then navigate into the directory where it once was.) Then enter:
    archive-list date filename
    to list the different dates for which versions are available. The dates refer specifically to the version archived at roughly 4:00am on that day; a date indicating "missing" indicates that no version of the file existed at that time, because either the file wasn't yet created, or because it was deleted at that point.

  3. To display a version of a file, you can type:
    archive-get date filename
    If you want to save that version onto the disk, enter:
    archive-get date filename destination

(Thanks to Hendrix student Thomas Przybylinski, who wrote the archive-list and archive-get Python scripts! These scripts provide a simple interface to the complex rdiff-backup archival program. Thanks also to Ben Escoto and the other rdiff-backup developers, without whom we wouldn't have daily backups.)