#!/usr/bin/python
# Written by Ethan Goff, for Boks, Fall 2015
# Backup Halfer... Halver..?
import os
import shutil
import inspect
from datetime import date

def main():
    cd = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # script directory
    print cd    
    r = []                                                                                                            
    subdirs = [x[1] for x in os.walk(cd)]    

    i = 0                
    
    subdir = ''                                               
    for subdir in subdirs[0]:      
        i = i+1                                                                          
        if (i%2 == 0) and (date.today().year.__str__() in subdir):
            print subdir
            shutil.rmtree("{0}/{1}".format(cd, subdir))


main()