#!/bin/sh

# make sure we're in the right place
cd /home/vv_volunteers/cat/public_html/movies/conv

# add a header to the movies SQL file
date >> movies.sql
echo '----------------------------------------------' >> movies.sql

# decompress running times list
# (keep original compressed file)
echo -en "Decompressing list...\t\t"
bunzip2 -k running-times.list.bz2
echo "Done."

# convert and redirect stdout to MySQL statement file
# (stderr is still on the terminal)
java Conv >> movies.sql

# remove running times list
rm -f running-times.list

# add a footer to the movies SQL file
echo '----------------------------------------------' >> movies.sql
echo >> movies.sql

