This site is brought to you by the Electrical and Computer Engineering department
Snapshots (Linux application server home directories)
What are snapshots?
Your ECE disk space takes automatic "snapshots" or backups of the files in your home directory every several hours during the day. These rolling backups are available up to one week in the past, meaning you have the ability to recover a file from your home directory as it existed up to a week ago. This is useful for times when you accidentally delete or overwrite a file.
The snapshots can be accessed using a special, hidden directory named .snapshot that exists for every directory in your home directory but doesn't display using any directory listing command or file browsing application.
In the .snapshot directories, you will find several directories named with a time interval and a number. For example, in the listing of contents for the .snapshot directory below:
% cd ~/.snapshot
% ls
daily.2025-03-30_0010
daily.2025-03-31_0010
hourly.2025-03-31_1005
hourly.2025-03-31_1105
hourly.2025-03-31_1205
hourly.2025-03-31_1305
hourly.2025-03-31_1405
hourly.2025-03-31_1505
weekly.2025-03-23_0015
weekly.2025-03-30_0015
...we have 2 daily snapshots, 6 hourly snapshots, and 2 weekly snapshots.
When are the snapshots are taken?
Hourly snapshots are taken every hour at 5 minutes past the hour. The most recent 6 are kept.
Daily snapshots are taken every day at 10 minutes after midnight UTC. The most recent 2 are kept.
Weekly snapshots are taken every Sunday at 15 minutes after midnight UTC. The most recent 2 are kept.
Tip: If you are in a UNIX shell, you can use the ls -lu command to print out a "long" directory listing of a .snapshot directory along with dates of when the snapshot were created.
How do I recover a file from a snapshot?
If you take a look inside one of the snapshot directories, you will notice that it is an exact copy of your files as they existed at the time the snapshot was taken. To recover a file found in a snapshot, simply copy it to where you want it. Let's take a look at some examples of recovering a file.
Example
For a directory named "demo" in a home directory with a file in it named “main.c”. The file “main.c” existed since yesterday before midnight, but I just now deleted it, at 10am. The latest hourly snapshot was taken at 8am, and since the file existed at that time, I will check there first:
ls .snapshot/hourly.2025-03-31_0805/demo/
Found it! Now let me copy it back to where it was:
cp .snapshot/hourly.2025-03-31_0805/demo/main.c ~/demo
I have now successfully restored the main.c file I accidentally deleted.
Note: If I had modified the file between when the most recent snapshot was taken (8am) and now (10am), I would have only been able to recover the file as it existed at 8am and would have lost my work between 8am and 10am.
I don't see my file in any of the snapshots, what's wrong?
Unfortunately, if you don't see the file in any of the snapshot directories, then:
You deleted the file one week ago or more and it's no longer available in even the oldest snapshot.
The file didn't exist in your home directory when a snapshot was taken (see the snapshot schedule above). This can happen if you create and delete your file between any scheduled snapshots. For example if you created a file at 9am and deleted it at 11am, it would not have been captured by either the 8am or noon snapshots and would be unrecoverable.
The ability to recover a file from your Linux home directory mounted on the Linux application servers depends on what times it existed in your home directory, how long it existed, and how long ago you deleted it.