Snapshots

What are snapshots?

Snapshots are a way of backing up directories in case of accidental user deletion, system failure, or similar events.


What directories have snapshots?

    • Home directories

    • Research shares (/vol/share/, smb://share.research.pdx.edu, and I:\\Research)

    • /vol/apps/

    • /workspace

        • Do not use workspace to store data long term, it is meant for active computational data.


What RC systems take snapshots of home directories?

    • Agamede

    • Hecate

    • Circe

    • Zelus

Note: Coeus and Gaia do not have snapshots of home directories.


How often are snapshots taken? How often are they removed? When are they taken?

Snapshots are taken hourly, daily, weekly, quarterly, and yearly.

    • Hourly snapshots are removed after about three days.

    • Daily and weekly snapshots are removed after about three months. These are taken just after midnight.

    • The oldest quarterly snapshot is removed as soon as three exist at once. These are taken at midnight on the first of January, April, July, and October.

    • At the strike of midnight, a new yearly snapshot is taken, and it replaces the previous snapshot.


Where are snapshots located?

Snapshots are in a hidden directory (.snapshot/), but it will not be listed via ls. Consider the below on Agamede where ls -a shows hidden files and directories.

$ cd ~

$ ls

code Downloads local

$ ls -a

. .bash_profile .config .kshrc .pki .vim .zshrc

.. .bashrc Downloads .lesshst .python_history .viminfo

.bash_history .cache .gitconfig local .ssh .vimrc

.bash_logout code .java .matlab .subversion .Xauthority

There is no .snapshot/ directory. However, the below works as .snapshot/ will only respond to commands that use its name specifically. This is done to make sure no one accidentally deletes this directory.

$ cd .snapshot

$ pwd

~/.snapshot


How do I roll back to a previous snapshot?

First, navigate to the snapshot directory for a home directory.

$ cd ~/.snapshot

Next, view the different snapshots saved to select the desired time frame. The anatomy of a snapshot is {type}.{YYYY}-{MM}-{DD}_{24 hour time}.

$ ls

daily.2019-12-18_0010 daily.2020-02-02_0010 daily.2020-03-19_0010 hourly.2020-03-18_1005

daily.2019-12-19_0010 daily.2020-02-03_0010 hourly.2020-03-16_1305 hourly.2020-03-18_1105

daily.2019-12-20_0010 daily.2020-02-04_0010 hourly.2020-03-16_1405 hourly.2020-03-18_1205

. . .

Once an adequate time frame has been selected, enter that directory.

$ cd hourly.2020-03-18_0905

Since this snapshot is within the home directory, it will contain a copy of the home at that point in time.

$ pwd

~/.snapshot/hourly.2020-03-18_0905

$ ls

code Downloads local

If a single file or directory needs to be restored, navigate to it and copy it to the desired location. For restoring a directory, this is recommended. The below will copy neededDir/ to the home directory. If neededDir/ already exists, it will update it to match the snapshot's neededDir/.

$ rsync -Pav neededDir/ ~/

Alternatively, it is possible to enter neededDir/ and place everything into the existing ~/neededDir/; this is shown below.

$ cd neededDir

$ rsync -Pav * ~/neededDir/