Restoring files from project directory snapshots

Creation date: 2/5/2025 11:16 AM    Updated: 2/5/2025 11:16 AM   backup restore snapshot
You can self-restore files from a system snapshot by following this procedure:

1. cd to the directory that contained the deleted file (or a revision you wish to overwrite) and look at the available snapshots:
sys:/u/project/project_dir_name/ABC/important/Genie/43a_gen# ls -l .snapshot
total 40
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 daily.2023-06-21_0010
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 daily.2023-06-22_0010
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 hourly.2023-06-22_2205
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 hourly.2023-06-22_2305
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 hourly.2023-06-23_0005
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 hourly.2023-06-23_0305
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 hourly.2023-06-23_0505
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 hourly.2023-06-23_0605
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 weekly.2023-06-11_0015
drwxrwsr-x. 2 14226 11483 4096 Apr  4  2022 weekly.2023-06-18_0015

Double check the status of the existing file in the live filesystem:

sys:/u/project/project_dir_name/ABC/important/Genie/43a_gen# ls -l very_important_file.txt
-rw-rw-r--. 1 14226 11483 0 Jun 22 20:57 very_important_file.txt

Copy the file from the selected snapshot to the live filesystem:

sys:/u/project/project_dir_name/ABC/important/Genie/43a_gen# cp .snapshot/daily.2023-06-21_0010/very_important_file.txt .
cp: overwrite `./very_important_file.txt'? y