awips2/deltaScripts/13.6.1/CleanupGfeHDF5Storage.py
Ron Anderson dc714d7260 Issue #1571 Refactored GFE to store GridParmInfo and ParmStorageInfo in PostGres
Change-Id: Iae7cf49fc18abf03ef3b0ee498fb8e658f37d1cf

Former-commit-id: 3de94947e0 [formerly 3fd2f523d9] [formerly 04d2fdc214] [formerly 3de94947e0 [formerly 3fd2f523d9] [formerly 04d2fdc214] [formerly 5aee6f35ff [formerly 04d2fdc214 [formerly 3094dc247a6de94ff00321d093b431e3f401b0c5]]]]
Former-commit-id: 5aee6f35ff
Former-commit-id: c17e493249 [formerly 06cbd815be] [formerly 288c866bff4b051e23f64443aa754d46ba800e69 [formerly f0fb2391af]]
Former-commit-id: 0a37062489f09181fd87da2090b4049989f9632f [formerly ddf03d171e]
Former-commit-id: 7928912dc5
2013-08-20 17:16:21 -05:00

59 lines
1.8 KiB
Python

#!/usr/bin/env python
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
#
# Update GFE HDF5 Group format to include minutes
#
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/18/10 njensen Initial Creation.
# 06/13/13 #2044 randerso Fixed to use correct python
#
#
#
import os
hdf5loc = "/awips2/edex/data/hdf5/gfe"
def processDir(dir):
# walk the directory tree removing *_GridParm.h5 files
for file in os.listdir(dir):
filePath = os.path.join(dir, file)
if os.path.isfile(filePath) and str(filePath).endswith("_GridParm.h5"):
print "Removing ", filePath
os.remove(filePath)
elif os.path.isdir(filePath):
processDir(filePath)
# if directory is empty remove it
if len(os.listdir(dir)) == 0:
print "Removing ", dir
os.removedirs(dir)
def main():
processDir(hdf5loc)
if __name__ == '__main__':
main()