#!/usr/bin/ksh #Make a directory for the month: #Get date; find month's name and make the appropriate file month=`date -u +%m'` year=`date -u +%Y'` case $month in 01) month_name="january" file_name="$month_name$year.html" dir_name="$month_name$year";; 02) month_name="february" file_name="$month_name$year.html" dir_name="$month_name$year";; 03) month_name="march" file_name="$month_name$year.html" dir_name="$month_name$year";; 04) month_name="april" file_name="$month_name$year.html" dir_name="$month_name$year";; 05) month_name="may" file_name="$month_name$year.html" dir_name="$month_name$year";; 06) month_name="june" file_name="$month_name$year.html" dir_name="$month_name$year";; 07) month_name="july" file_name="$month_name$year.html" dir_name="$month_name$year";; 08) month_name="august" file_name="$month_name$year.html" dir_name="$month_name$year";; 09) month_name="september" file_name="$month_name$year.html" dir_name="$month_name$year";; 10) month_name="october" file_name="$month_name$year.html" dir_name="$month_name$year";; 11) month_name="november" file_name="$month_name$year.html" dir_name="$month_name$year";; 12) month_name="december" file_name="$month_name$year.html" dir_name="$month_name$year";; esac mkdir /disks/soleil/home/www/hessi/data/spectrometer/plots/archive/$dir_name mkdir /disks/soleil/home/www/hessi/data/spectrometer/plots/archive/$dir_name/plot1 mkdir /disks/soleil/home/www/hessi/data/spectrometer/plots/archive/$dir_name/plot2 #Add a link to the center block of the html page print "
  • $month_name $year
  • \n\n" >> "/disks/soleil/home/www/hessi/data/spectrometer/center.html" #combine header, center, and footer while read -r line; do print $line done < "/disks/soleil/home/www/hessi/data/spectrometer/header.html" > "/disks/soleil/home/www/hessi/data/spectrometer/index.html" while read -r line; do print $line done < "/disks/soleil/home/www/hessi/data/spectrometer/center.html" >> "/disks/soleil/home/www/hessi/data/spectrometer/index.html" while read -r line; do print $line done < "/disks/soleil/home/www/hessi/data/spectrometer/footer.html" >> "/disks/soleil/home/www/hessi/data/spectrometer/index.html" #move the "center" file full of last month's links mv /disks/soleil/home/www/hessi/data/spectrometer/plots/archive/center /disks/soleil/home/www/hessi/data/spectrometer/plots/archive/centerold