# Splits /dimv9p_enc/data/radrev/2005/186 into smaller subdirectories 
# of about 450-500 MB each.
#
# 2006-10-12, sam:  Ran this script in the /n/diraid02/data/lien/data/ 
# area which has not been touched since the data were copied to 
# /n/pdsraid01/archive/, then moved the tars to /n/pdsraid01/archive/.
#

cd /n/diraid02/data/lien/dimv9p_enc/data/radrev/2005/

mkdir 186a
mkdir 186b
mkdir 186c
mkdir 186d


# Use the exposure ID in the file names to move data from
# the daily directory to the 'part' directories

mv 186/*_90800* 186a/
mv 186/*_90900* 186b/
mv 186/*_91000* 186c/
mv 186/*_91100* 186d/
mv 186/*_91200* 186d/


# Make sure 186 directory is empty

find 186/

cd /n/diraid02/data/lien/dimv9p_enc/

tar cvf DOWNLOAD/2005186a.tar data/radrev/2005/186a
tar cvf DOWNLOAD/2005186b.tar data/radrev/2005/186b
tar cvf DOWNLOAD/2005186c.tar data/radrev/2005/186c
tar cvf DOWNLOAD/2005186d.tar data/radrev/2005/186d

mv DOWNLOAD/2005186a.tar /n/pdsraid01/archive/dimv9p_enc/DOWNLOAD/
mv DOWNLOAD/2005186b.tar /n/pdsraid01/archive/dimv9p_enc/DOWNLOAD/
mv DOWNLOAD/2005186c.tar /n/pdsraid01/archive/dimv9p_enc/DOWNLOAD/
mv DOWNLOAD/2005186d.tar /n/pdsraid01/archive/dimv9p_enc/DOWNLOAD/


# Move data back from 'part' directories back to the original DOY directory

cd /n/diraid02/data/lien/dimv9p_enc/data/radrev/2005/

mv 186a/* 186/
mv 186b/* 186/
mv 186c/* 186/
mv 186d/* 186/