# Exports the records to
create an empty database
# Useful if you sell the bike,
and buy a new one
echo "Exporting Dataset"
echo "Please enter a brief name for the dataset you are exporting"
echo ""
echo "The Bike Name is sufficient, but no spaces please"
read datasetname
if [ -e ./archives ]
then
echo "Good the Archives folder already exists"
else
mkdir archives
fi
# Note in the HTML Log that
the dataset has been exported
cat ./html/full.html | grep -iv "</html>" > htmltmp.1
cat htmltmp.1 | grep -iv "</body>" > htmltmp.2
rm -f htmltmp.1
echo "<br><br><b>Dataset exported $dates - Final
Fulllog can" >> htmltmp.2
echo "be found <a href=../fulllog target=_blank>here.</a>"
>> htmltmp.2
echo "</body>" >> htmltmp.2
echo "</html>" >> htmltmp.2
mv htmltmp.2 html/full.html
# Now we need to generate the
fulllog one last time
source ./datarefs/fullreportlist
mv fulllog ./archives/"$datasetname"
# Now we move the other items
over
mkdir ./archives/"$datasetname"
mv data ./archives/"$datasetname"/
mv html ./archives/"$datasetname"/
mv datarefs/* ./archives/"$datasetname"/
echo ""
echo "Exported the data into a folder called $datasetname"
# Add the archive into the
archive navigation system.
echo "Please Wait While I add the dataset to the Archives Page"
if [ -e ./archives.html ]
then
cat ./archives.html | grep -iv "</html>" > archives1.html
cat ./archives1.html | grep -iv "</body>" > archives2.html
rm ./archives1.html
mv archives2.html archives.html
else
echo "<html><head><title>BikeMaintain
Archives</title>" > ./archives.html
echo
"</head><body><center><b><u>BikeMaintain
Archives</b></u></center>" >> ./archives.html
echo "<br><br><b><u>Archived
Datasets:</b></u><br><br>" >>
./archives.html
fi
echo -n "<a href=archives/" >> ./archives.html
echo -n "$datasetname" >> ./archives.html
echo "/html/full.html target=_blank>Archive of
$datasetname</a>" >> ./archives.html
echo " - Exported $DATE <br>" >> ./archives.html
echo "</body>" >> ./archives.html
echo "</html>" >> ./archives.html
# And thats the bike details
finalised, How sad :-(
echo "If you wish to create a new database, please generate the new
pages (option 9)"
./bikemaintain