# Splits /dimv9p_enc/data/radrev/2005/183 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 183a
mkdir 183b
mkdir 183c
mkdir 183d
mkdir 183e
mkdir 183f


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

mv 183/*_850043* 183a/
mv 183/*_850044* 183a/
mv 183/*_850045* 183a/
mv 183/*_850046* 183a/
mv 183/*_850047* 183a/
mv 183/*_850048* 183a/
mv 183/*_850049* 183a/

mv 183/*_850050* 183b/
mv 183/*_850051* 183b/
mv 183/*_850052* 183b/
mv 183/*_850053* 183b/
mv 183/*_850054* 183b/
mv 183/*_850055* 183b/

mv 183/*_850056* 183c/
mv 183/*_850057* 183c/
mv 183/*_860000* 183c/
mv 183/*_860001* 183c/
mv 183/*_860002* 183c/
mv 183/*_860003* 183c/
mv 183/*_860004* 183c/
mv 183/*_860005* 183c/
mv 183/*_860006* 183c/

mv 183/*_860007* 183d/
mv 183/*_860008* 183d/
mv 183/*_860009* 183d/
mv 183/*_860010* 183d/
mv 183/*_860011* 183d/
mv 183/*_860012* 183d/
mv 183/*_860013* 183d/
mv 183/*_860014* 183d/

mv 183/*_860015* 183e/
mv 183/*_860016* 183e/
mv 183/*_860017* 183e/
mv 183/*_860018* 183e/
mv 183/*_880000* 183e/
mv 183/*_880001* 183e/
mv 183/*_880002* 183e/
mv 183/*_880003* 183e/
mv 183/*_880004* 183e/
mv 183/*_8800051* 183e/
mv 183/*_8800052* 183e/
mv 183/*_8800053* 183e/
mv 183/*_8800054* 183e/
mv 183/*_8800055* 183e/

mv 183/*_880005* 183f/
mv 183/*_880006* 183f/
mv 183/*_880011* 183f/
mv 183/*_880012* 183f/
mv 183/*_880013* 183f/
mv 183/*_880014* 183f/
mv 183/*_880015* 183f/
mv 183/*_880016* 183f/
mv 183/*_880017* 183f/
mv 183/*_880018* 183f/


# Make sure 183 directory is empty

find 183/

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

tar cvf DOWNLOAD/2005183a.tar data/radrev/2005/183a
tar cvf DOWNLOAD/2005183b.tar data/radrev/2005/183b
tar cvf DOWNLOAD/2005183c.tar data/radrev/2005/183c
tar cvf DOWNLOAD/2005183d.tar data/radrev/2005/183d
tar cvf DOWNLOAD/2005183e.tar data/radrev/2005/183e
tar cvf DOWNLOAD/2005183f.tar data/radrev/2005/183f


mv DOWNLOAD/2005183a.tar /n/pdsraid01/develop/dif-c-mri-3-nav-9p-encounter-v1.0/DOWNLOAD/
mv DOWNLOAD/2005183b.tar /n/pdsraid01/develop/dif-c-mri-3-nav-9p-encounter-v1.0/DOWNLOAD/
mv DOWNLOAD/2005183c.tar /n/pdsraid01/develop/dif-c-mri-3-nav-9p-encounter-v1.0/DOWNLOAD/
mv DOWNLOAD/2005183d.tar /n/pdsraid01/develop/dif-c-mri-3-nav-9p-encounter-v1.0/DOWNLOAD/
mv DOWNLOAD/2005183e.tar /n/pdsraid01/develop/dif-c-mri-3-nav-9p-encounter-v1.0/DOWNLOAD/
mv DOWNLOAD/2005183f.tar /n/pdsraid01/develop/dif-c-mri-3-nav-9p-encounter-v1.0/DOWNLOAD/


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

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

mv 183a/* 183/
mv 183b/* 183/
mv 183c/* 183/
mv 183d/* 183/
mv 183e/* 183/
mv 183f/* 183/