UMBC logo
UMBC High Performance Computing Facility
Please note that this page is under construction. We are documenting the 240-node cluster maya that will be available after Summer 2014. Currently, the 84-node cluster tara still operates independently, until it becomes part of maya at the end of Summer 2014. Please see the 2013 Resources Pages under the Resources tab for tara information.
Accessing your backups on maya

Introduction

Periodic backups of some of your directories are taken on maya, in case of accidental loss of work. On this page we will show you how to access these backups.

A walk through the backup area

There is a hidden ".zfs" directory at the top level of your PI's research storage. However, it may not show up at all when using the "ls" command. Suppose "gobbert" is our PI for the remainder of this page.
[araim1@maya-usr1 ~]$ ls -a /umbc/research/gobbert/
.  ..  common/ users/
[araim1@maya-usr1 user-resources]$ ls -ld /umbc/research/gobbert/.zfs
dr-xr-xr-x 4 root root 4 Feb 18  2010 /umbc/research/gobbert/.zfs
Inside this directory are snapshots taken periodically by the system
[araim1@maya-usr1 ~]$ cd /umbc/research/gobbert/.zfs/
[araim1@maya-usr1 .zfs]$ ls -a
.  ..  shares  snapshot
[araim1@maya-usr1 .zfs]$ cd snapshot/
[araim1@maya-usr1 snapshot]$ ls -la
total 40
dr-xr-xr-x 12 root    root       12 Jul  5 03:00 .
dr-xr-xr-x  4 root    root        4 Feb 18  2010 ..
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309071600
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309158000
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309244400
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309330800
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309417200
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309503600
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309590000
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309676400
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309762800
drwxrws---  4 gobbert pi_gobbert  6 May  4  2009 .auto-1309849200
[araim1@maya-usr1 snapshot]$ 
Note that the timestamps on these directories do not reflect their creation time. However, the number in the filename represents the number of seconds from the Unix epoch (Jan 1, 1970) in which the snapshot was created. This timestamp will be important to us when identifying the right backup to use. We can quickly convert this epoch time into a more human-readable time using the date command
[araim1@maya-usr1 snapshot]$ date --date "Jan 1, 1970 + 1309071600 seconds"
Sun Jun 26 08:00:00 EDT 2011
Once you've identified a usable backup, you can browse inside of it like any other directory, and copy files back into your permanent area.
[araim1@maya-usr1 snapshot]$ cd .auto-1309071600
[araim1@maya-usr1 .auto-1309071600]$ cp -r common/important-project /umbc/research/gobbert/common/
In the snapshot directory listing, we can convert all the timestamps to human readable times. We've set up the command "list-snapshots" as a convenience. It takes one argument, which is the name of the research mount to view. (That is, the name of the subdirectory in "/umbc/research" whose backups we want to list).
[araim1@maya-usr1 ~]$ list-snapshots gobbert
Snapshots for research mount 'gobbert':
TIME                    	PATH
Mon Aug  1 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312182000
Tue Aug  2 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312268400
Wed Aug  3 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312354800
Thu Aug  4 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312441200
Fri Aug  5 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312527600
Sat Aug  6 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312614000
Sun Aug  7 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312700400
Mon Aug  8 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312786800
Tue Aug  9 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312873200
Wed Aug 10 03:00:00 2011	/umbc/research/gobbert/.zfs/snapshot/.auto-1312959600
[araim1@maya-usr1 ~]$ 
Notice that the snapshots are currently taken once per day at 03:00. These timestamps are recorded in UTC rather than in the local time zone, so make sure to interpret them accordingly. (To convert from UTC to EDT for example subtract 4 hours. To convert from UTC to EST subtract 5 hours. The entries in this example are from August, so the timestamp in local time would be 23:00:00 EDT).

Advanced Usage: Scripting it yourself

For more advanced users, we demonstrate how to convert the timestamps manually using Bash scripting. This also serves as an example of writing loops directly on the command line.

[araim1@maya-usr1 snapshot]$ for d in .auto-*
> do
>   timestamp=${d#*-};
>   ts=$(date --date "Jan 1, 1970 UTC + $timestamp seconds" +"%a %x %T UTC");
>   echo -e "$ts\t$d";
> done
Sun 06/26/2011 03:00:00 UTC     .auto-1309071600
Mon 06/27/2011 03:00:00 UTC     .auto-1309158000
Tue 06/28/2011 03:00:00 UTC     .auto-1309244400
Wed 06/29/2011 03:00:00 UTC     .auto-1309330800
Thu 06/30/2011 03:00:00 UTC     .auto-1309417200
Fri 07/01/2011 03:00:00 UTC     .auto-1309503600
Sat 07/02/2011 03:00:00 UTC     .auto-1309590000
Sun 07/03/2011 03:00:00 UTC     .auto-1309676400
Mon 07/04/2011 03:00:00 UTC     .auto-1309762800
Tue 07/05/2011 03:00:00 UTC     .auto-1309849200
[araim1@maya-usr1 snapshot]$ 
We can modify our script to convert the times to our local time zone as well
[araim1@maya-usr1 snapshot]$ for d in .auto-*;
> do
>   timestamp=${d#*-};
>   utcdate=$(date --date "Jan 1, 1970 UTC + $timestamp seconds" +"%a %x %T UTC");
>   ts=$(date --date "$utcdate" +"%a %x %T %Z");
>   echo -e "$ts\t$d";
> done;
Sat 06/25/2011 23:00:00 EDT     .auto-1309071600
Sun 06/26/2011 23:00:00 EDT     .auto-1309158000
Mon 06/27/2011 23:00:00 EDT     .auto-1309244400
Tue 06/28/2011 23:00:00 EDT     .auto-1309330800
Wed 06/29/2011 23:00:00 EDT     .auto-1309417200
Thu 06/30/2011 23:00:00 EDT     .auto-1309503600
Fri 07/01/2011 23:00:00 EDT     .auto-1309590000
Sat 07/02/2011 23:00:00 EDT     .auto-1309676400
Sun 07/03/2011 23:00:00 EDT     .auto-1309762800
Mon 07/04/2011 23:00:00 EDT     .auto-1309849200
[araim1@maya-usr1 snapshot]$