Skip to main content

Restoring Lost Files

If you damage or remove files from your home directory, you can restore them yourself by copying them from a backup directory.

Backup copies of SSCC home directories are made each night. To minimize time and storage, changes are stored in the form of "snapshots." The file system manages those snapshots in such a way as to make it appear as if all of your files were backed up each night.

The previous night's snapshot is found in the Backup directory. In addition, we take snapshots on the following schedule:

The snapshot backup of the home directory tree taken at midnight each day is stored in /sscc/backup, which makes it easy to retrieve a file as it was yesterday. The first section of this web page, Restoring Files From Your Backup Directory, explains how to do just that.

The section Restoring Files from Other Snapshots explains how to restore a file from older snapshots. And, if you're still having problems restoring a file, see Further Help Restoring Files.

Restoring Files from Your Backup Directory

The daily SSCC backup directory tree is organized in a manner that parallels the directory tree for SSCC home directories. That makes it easy to restore a file from yesterday's backup directory.

EXAMPLE: You have a damaged file diskuse.dat in your subdirectory statistics. You wish to restore it from yesterday's backup snapshot. The first thing to do is change your working directory to your statistics subdirectory and determine the full path to that subdirectory:

[abc123@hardin ~]$ cd ~abc123/statistics
[abc123@hardin statistics]$ pwd /sscc/home/b/abc123
/statistics

The full path to ~abc123/statistics is /sscc/home/b/abc123/statistics. The path to the backup snapshot copy is /sscc/backup/b/abc123/statistics. If you compare the two paths, you see that home is replaced by backup and everything else remains the same. Now make sure that there is a copy of diskuse.dat in your backup directory:

[abc123@hardin statistics]$ ll /sscc/backup/b/abc123/statistics/diskuse.dat
-rw------- 1 abc123 users 32294 Feb 8 1999 /sscc/backup/b/abc123/diskuse.dat

Good! Your file is there! Now you can remove the bad file in your home directory.

[abc123@hardin statistics]$ rm diskuse.dat

Then copy the good version of diskuse.dat from your backup fileset:

[abc123@hardin statistics]$ cp -p /sscc/backup/b/abc123/statistics/diskuse.dat diskuse.dat
[abc123@hardin statistics]$ ll diskuse.dat
-rw------- 1 abc123 users 32294 Feb 8 1999 diskuse.dat

Note that the copy retains its creation date and access modes. That's because you specified the -p option on your cp command. The file is restored!

Restoring Files from Other Snapshots

Snapshots of /sscc are stored in the directory /sscc/.snapshot. Each snapshot directory is named in such a way that explains the date when it was taken and whether it is a Daily, Weekly or Monthly snapshot. Here is an example:

[abc123@seldon ~]$ cd /sscc/.snapshot
[abc123@seldon .snapshot]$ ls | more
Daily
Monthly
SSCC_Daily_2007_09_19
SSCC_Daily_2007_09_20
SSCC_Daily_2007_09_21
SSCC_Daily_2007_09_22
SSCC_Daily_2007_09_23
SSCC_Daily_2007_09_24
SSCC_Daily_2007_09_25
SSCC_Monthly_2007_09_01
SSCC_Weekly_2007_08_26
SSCC_Weekly_2007_09_02
SSCC_Weekly_2007_09_09
SSCC_Weekly_2007_09_16
SSCC_Weekly_2007_09_23
Weekly
[abc123@seldon .snapshot]$

The directories named Daily, Monthly and Weekly are the most recent snapshot in each category. (Daily being the most current Daily snapshot.) The snapshots are also named in such a manner that their role (Daily, Weekly and Monthly) and the date they were taken is obvious.

Note that each snapshot is taken of the very large directory tree that starts at /sscc. The following example shows how to retrieve the same ~abc123/statistics/diskuse.dat file from the September 19th snapshot:

[abc123@seldon statistics]$ cd /sscc/.snapshot
[abc123@seldon .snapshot]$ echo $HOME

/sscc/home/b/abc123
[abc123@seldon .snapshot]$ cd SSCC_Daily_2007_09_19/home/b/abc123/statistics/

The method to use is to first change directories to /sscc/.snapshot and then to determine the path to your home directory with the command echo $HOME. Then change directories to the snapshot of your choice, using that directory name in place of the /sscc at the beginning of the path to your home directory. Make sure that you do so using the relative path, without the leading /. Then follow the example above to copy diskuse.dat from the September 19th snapshot to your home directory.

Further Help Restoring Files

If you need assistance to restore a file from a snapshot directory, send an e-mail message to sscc-support@northwestern.edu. to make your request. Be sure to specify the full path to your file, including all of the subdirectories along the way. And indicate the most recent date when the contents of the file were correct. That will enable the system administrator to select the correct snapshot directory from which to restore the file.

Last Updated: 24 January 2017

Get Help Back to top