Home directories at HPC2021 are supported by Pure Storage. A daily snapshot (usually around 4 am local time) will be done and a maximum of 7 of them are kept. Pure Storage snapshots are read-only and you are able to retrieve the files from such snapshots. Here is how:
To get a list of snapshots, you may do:
ls -l /home/user.name/.snapshot/
total 0
drwx------ 1 user.name group.name 0 Apr 2 04:00 daily.17295
drwx------ 1 user.name group.name 0 Apr 3 04:00 daily.17839
drwx------ 1 user.name group.name 0 Apr 4 04:00 daily.18384
drwx------ 1 user.name group.name 0 Apr 5 04:00 daily.18929
drwx------ 1 user.name group.name 0 Apr 6 04:00 daily.19477
drwx------ 1 user.name group.name 0 Apr 7 04:00 daily.20022
drwx------ 1 user.name group.name 0 Apr 8 04:00 daily.20570
You can see the corresponding snapshot creation time of each snapshot name.
The contents of your home directory at that specified moment is kept in the snapshot (which is always read-only, regardless of what the Unix permission bits say). For example, with the following command the snapshot of the file on 07 April could be found:
ls -al /home/user.name/.snapshot/daily.20022/deleted_file
You may also use your editor/readers to view a read-only file with a full path. However, in order to get the file back, you should copy it back to your active folder. Note the use of the -a
flag which also copies the file attributes:
cp -a /home/user.name/.snapshot/daily.20022/deleted_file /home/user.name/deleted_file