Retrieving Deleted Files

In your /g home directory there is a special hidden directory called .snapshot. As a "hidden" directory, it is not listed by the ls command but you can cd into it.

In the .snapshot directory you will find four full backup copies of your home directory. (After you cd to the .snapshot directory, type ls -lu to list the directories and the actual date and time of each backup.)

  • hourly.0 [most recent backup]
  • hourly.1 [next most recent]
  • hourly.2 [third most recent]
  • hourly.3 [fourth most recent]

Backup snapshots are created twice each day, 1200 and 1900. These files and directories are read-only and may be copied as needed to your regular home directory. In addition, system backups are done on a nightly basis.

Two typical file deletion/retrieval scenarios are presented below.

Scenario 1

It is now 4:00 p.m. on 8/19/05.

hourly.0 contains the 1200 backup from 8/19/05
hourly.1 contains the 1900 backup from 8/18/05
hourly.2 contains the 1200 backup from 8/18/05
hourly.3 contains the 1900 backup from 8/17/05

You have accidentally deleted file1 from your home directory, and you want to retrieve it. You simply go to the appropriate .snapshot directory and list the files. You see file1 listed, and you copy file1 back into your home directory.

cd .snapshot/hourly.0
ls -l
cp file1 ~

Scenario 2

It is 9:00 a.m., and you have been working on file2 in your home directory. You want a copy of file2 as it was the morning of the previous day, before you made yesterday's and today's changes. From your home directory, you simply enter:

cp .snapshot/hourly.2/file2 file2.old

There are .snapshot online backup directories for several other NFS-provided file systems, including /usr/gapps, /usr/local, and user group-owned file systems. Files can be recovered on those file systems by following the same steps as shown in the sample scenarios above. Online backups are created in the same manner on SCF as on the OCF.

On most platforms, you will not be allowed to overwrite an existing file with the .snapshot copy. Either remove (rm) or move (mv) the existing file before copying from .snapshot.

Note: There are no .snapshot directories (or any other form of backup) for any "tmp" directories, including /usr/tmp, /nfs/tmp*, gpfs, or Lustre file systems.