whats going on guys. below is a script i made and am just curious if there is a "time stamp" command. so i can set the timestamp in a filename.
#! /bin/ksh
#
# This scripts takes a list of files in the INDIR variable and compairs it to a list of files that are open in the same directory.
# If this list is not the same it will continue the rest of the script.
#
# INDIR = where the program writes the file
# ARCHIVEDIR = where you want to archive the files\
# where each file will get its own directoy and each file inside of that dir will get a time stamp.
# OUTDIR = where you want the files moved to for other processes to handel
# FUUSER = user to change ownership to after move ; and used in the search for open files
# FUGROUP = group to change ownership to after move
# OPENFILE = a list of open files in the INDIR
#
# by: Mike Dooley miked_1978@yahoo.com 05-17-01
INDIR="/conway_od01/drop"
ARCHIVEDIR="/conway_od01/archive_messages"
OUTDIR="/conway_od01/edi_out"
FUUSER="conwayod"
FUGROUP="foursite"
OPENFILE=`/usr/local/bin/lsof +d ${INDIR}|grep ${FUUSER}|awk -F"/" '{ print $4 }'`
if [[ -d ${INDIR} ]] ; then
cd $\{INDIR\}
for file in \`ls\` ; do
if [[ $file != $\{OPENFILE\} ]]; then
mkdir $\{ARCHIVEDIR\}/$file 1>/dev/null 2>/dev/null
cp $file $\{ARCHIVEDIR\}/$file/\`date \+%b\_%e\_%Y\_%T\`_$file
mv $file $\{OUTDIR\}/$file
fi
done
fi