The University of Texas at Austin

Web Publishing on Unix

Recovering Deleted or Corrupted Files Using Snapshots

For the following procedures, make sure you have logged in to an SSH Client and are at the Unix terminal. Instructions on how to log in to an SSH Client can be found at the Help page.

To submit a command line in Unix, press Enter.

Viewing Snapshots

UTS and Web Central files are stored on NetApp filers, which create and store snapshots of directories at hourly, daily, and weekly intervals. With these snapshots, recently deleted or corrupted files can be restored to a previous state.

To view available snapshots, navigate to the folder containing the file that needs to be restored, and enter the command:

ls -lt .snapshot/*/

This will return a list of available snapshots for files in the current directory. A typical snapshot will resemble something like this:

`.snapshot/sv_hourly.1/:

total 24

-rw-r--r-- 1 username users 200 Oct 23 2004 filename1.txt

-rw-r--r-- 1 username users 387 Oct 29 2004 filename2.txt

-rw-r--r-- 1 username users 694 Oct 29 2004 filename3.txt`

Note: The most recent snapshots are suffixed with .0, so sv_hourly.0 will provide a more recent snapshot than sv_hourly.1.

Restoring Files from a Snapshot

To restore a file from a snapshot, use the copy command

cp .snapshot/snapshotname/filename newfilename

From the above example, to copy filename1.txt from the sv_hourly.1 snapshot to the current directory, enter

cp .snapshot/sv_hourly.1/filename1.txt newfilename

If you want the new file's name identical to an existing file, rename or delete the existing file first, and then proceed with copying from the snapshot.

Note: Data stored inside a snapshot directory can only be copied; contents cannot be added, moved, or modified.

Last updated February 12, 2013 @ 4:03 pm

We Can Help

Get help from an expert at the ITS Help Desk!

* Call us at 512-475-9400

* Submit a help request online

We also have a walk-in service in the first floor lobby of the Flawn Academic Center (FAC). Stop by and let us help you!