How-to: Restoring a deleted file or directory

Action

How-to restore a deleted directory or file from a snapshot of my home or lab directory.

Instructions

$LAB and $HOME directories are backed up with "snapshots" hourly for the last 23 hours and daily for the last 23 days. If you need to restore a file or directory to a previous version within the time constraints of snapshot, follow the instructions below.

 Windows

Windows Mapped Drive

Windows makes it easy to restore a file or directory from your $LAB or $HOME directory, as long as it is mapped to your computer. Remember, you need to be connected to the VPN to access a mapped directory from off campus.

  1. Navigate to the folder or directory file the Windows File Explorer
  2. Right-click on the file, and click restore previous versions
  3. Navigate to the version you would like to restore, and hit Restore

    This will overwrite the existing file in the directory!

 SSH terminal

SSH Terminal

Snapshots can be accessed and restored from an SSH terminal from any operating system. Please follow How-to: Connect via SSH (PuTTY, macOS terminal) for more information on connecting via SSH.

  1. Open an SSH connection to head-01.arcc.albany.edu
  2. Using the "cd" command, change directories to the file or directory that needs to be restored

    cd /network/rit/lab/[lab_directory]/[]

    In this example, we will demonstrate with an example file

  3. Use the "ls" command to check if the file is in the directory, here we will restore spawn_jupyter.sh

  4. Now, "cd" into the ".snapshot" directory, and "ls" to see what snapshots are available. Note that the snapshots are additional directories.
  5. "cd" into the appropriate snapshot directory. Here we are restoring the backup from 0825 on 15 Apr 2019
  6. You can check the file with the "more" command, or other command of your choice
  7. Next, "cp" the file two directories up (../../) and rename it if you'd like to. Here, we append _restored so the files can be further compared
  8. Navigate out of the snapshot (cd ../../), to the original directory and verify the restored file is there



Need more help? Contact the ITS Service Desk.