#!/bin/csh -f

# file_list version 1.0

# This simple script written by Joseph Traub (jtraub@cs.cmu.edu)
# Feel free to use it, hack it, have sex with it, or whatever.
# Author disclaims any responsibility whatsoever for any acts performed
# with this script or any derivitive thereof.

# Set this to point to the top level of your FSP export directory
set FSP_HOME = /usr/fsp/data

# Set this to the place you want to store temporary files.
set TMP_DIR = /usr/tmp

# set this to where convdate resides so it can be invoked.
set MY_DIR = /usr/fsp/bin

set date = `date`
set rdate = `$MY_DIR/convdate -y $date`

# Remove the old file list(s) first so that they don't show up in the new one.
\rm -rf $FSP_HOME/files_list*.Z >& /dev/null

ls -lRF $FSP_HOME | grep -v .OWN | grep -v .FSP > $TMP_DIR/files_list
compress $TMP_DIR/files_list


if ( -e $TMP_DIR/files_list.Z ) then
  mv $TMP_DIR/files_list.Z $FSP_HOME/files_list_$rdate.Z
endif

exit 0
