| User Opinions |
|
No users have voted.
|
|
Thank you for rating this answer.
|
Restoring Deleted Files
Each account on andromeda/pegasus is provided with their own invisible backup read-only sub-directory named .snapshot. Every few hours, a new snapshot(copy) of your HOME directory is taken and stored in its own .snapshot subdirectory., As new snapshots are
created they will take the place of older snapshots.
To illustrate how to restore a file from .snapshot, I'll use an
example. User nwkhelp removed the file: $HOME/samplefile and the directory $HOME/sampledir and wishes to restore them
from the last snapshot..To access your .snapshot subdirectory, ssh into your unix account. The snapshot directory is not detectable by the ls command. Change to the snapshot subdirectory by entering
cd .snapshot (please include the period .)
Once in the snapshot subdirectory enter
ls -ltu
A partial listing of the results of the above command are included below
drwx--x--x 31 nwkhelp rucsnwk 12288 Mar 18 08:00 hourly.0 drwx--x--x 31 nwkhelp rucsnwk 12288 Mar 18 03:00 sv.0 drwx--x--x 31 nwkhelp rucsnwk 12288 Mar 18 00:00 nightly.0 drwx--x--x 31 nwkhelp rucsnwk 12288 Mar 17 20:00 hourly.1 drwx--x--x 31 nwkhelp rucsnwk 12288 Mar 17 16:00 hourly.2 drwx--x--x 31 nwkhelp rucsnwk 12288 Mar 17 12:00 hourly.3 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 17 03:00 sv.1 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 17 00:00 nightly.1 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 16 00:00 nightly.2 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 15 00:00 nightly.3 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 14 00:00 nightly.4 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 13 00:00 nightly.5 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 12 00:00 nightly.6 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 11 00:00 nightly.7 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 10 00:00 nightly.8 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 9 00:00 nightly.9 drwx--x--x 30 nwkhelp rucsnwk 12288 Mar 8 00:00 nightly.10
There are two types of snapshots. As their file names imply, they are performed on a nightly and hourly basis. The smallest number
snapshot is the most recent one. The file hourly.0 is always the most recently created snapshot. The next most recently created snapshot is always hourly.1. The hourly filename may need at least a partial clarification. The snapshots are taken four times a day not each hour of the day. The current schedule for hourly snapshots are
08:00 12:00 16:00 20:00
There may be some variability in the above listed schedule based upon system constraints. To determine when a snapshot was taken use the ls -ltu command.
Every night at midnight a snapshot is taken and is stored in nightly.0. The last midnight's snapshot is stored in nightly.0, the prior midnight snapshot is stored in nightly.1 etc. Locate the file/directory you would like to copy. Move(cd) to the directory that contains the item to be copied. As an example cd hourly.0 <-move to the directory that contains the file to copy ls -l <-list the contents if the directory
-rw-r--r-- 1 nwkhelp rucsnwk 1998 Dec 9 2007 sample.1 -rw-r--r-- 1 nwkhelp rucsnwk 1064 Aug 30 2006 sample.2 -rw-r--r-- 1 nwkhelp rucsnwk 2 Mar 17 12:21 samplefile
You can copy the file by using the unix cp command, or cp -R for a directory to a location you specify. In the above example you would enter
cp samplefile ~/samplefile (copies file to your home directory)
|