Search CS
Contact Us
Computer Science DepartmentSwarthmore College
500 College Avenue
Swarthmore, PA 19081
Phone: 610.328.8272
Fax: 610.328.8606
Email: info at cs.swarthmore.edu
Copyright 2009 Swarthmore College. All rights reserved.
retrieving a lost file
If you accidentally wiped out an important file, here are a few options:
- e-mail
immediately
We do back-ups of the user disks every morning at 4am. Sometimes (due to limited resources) we overwrite the previous night's backup tape. If the only copy of the file you just deleted is on one of these tapes (that is about to be overwritten), the sooner we know about it, the better chance we have of saving it (either pulling the file off the tape, or at least not overwriting the tape).
In your email to local-staff, please include the following:
- the name of the file
- the location of the file (e.g., my cs21 dir)
- when the file was last modified
- and how much of an emergency this is (e.g., my HW is due now!)
- copy your lost file from /snapshots
We make a copy (i.e., take a snapshot) of the user filesystem every day at noon, 4pm, 8pm, midnight, and 4am. If you delete an important file, hopefully one of these snapshots will allow you to recover some of your work (if not, hopefully the daily tape backups mentioned above can help). We store these snapshots in a directory called /snapshots, and users should be able to copy their own files back from there. In addition to the hourly snapshots mentioned above, we save the noon snapshot each day for three days, just in case. All other hourly snapshots are overwritten the next day, so copy your missing files back as soon as you can.
Here's how to copy your files back from /snapshots:
- cd into /snapshots: cd /snapshots
- cd into the appropriate subdirectory: cd hourly.1 (or daily.2, etc)
- figure out which disk your home dir is on: grep -w username /etc/auto.home
- cd into your home dir and find the file: cd users1/username (or users2)
- copy the file(s) back to your home dir: cp file /home/username/.
Here's a specific example, for user jk:
$ cd /snapshots $ ls -l total 120 drwxr-xr-x root root 4096 Dec 12 12:51 daily.0 drwxr-xr-x root root 4096 Dec 11 12:50 daily.1 drwxr-xr-x root root 4096 Dec 10 12:49 daily.2 drwxr-xr-x root root 4096 Dec 13 00:49 hourly.0 drwxr-xr-x root root 4096 Dec 12 20:47 hourly.1 drwxr-xr-x root root 4096 Dec 12 16:52 hourly.2 drwxr-xr-x root root 4096 Dec 12 12:51 hourly.3 $ cd hourly.3 $ grep -w jk /etc/auto.home jk allspice:/export/home/users2/& $ cd users2/jk $ ls Mail/ cs21/ hw1/ prog* a.out* cs22/ mail/ prog.c $ cp prog.c /home/jk/. $ cd
- if you are using emacs, look for tilde files (e.g., hw5.c~)
By default, emacs saves a copy of your file each time you start editing it. If your file is called hw5.c, emacs will save a copy to hw5.c~. Look for these tilde files if you accidentally wipe out your homework program.