Hi all:
I am new to this board and UNIX programming so please forgive if I don't explain something correctly.
I am trying to write a script to keep track of our links, we link one program written for Client A to Client B's directory.
What we want to do is to keep track of our linked programs to be sure they aren't getting unlinked, or lost. Track any changes from day to day. This script will be run from cron nightly.
My plan was to do an ll -R in 2 directories (LINKLOG and LINKTESTLOG that contain the programs, do a find of all links. sdiff from the previous days links to current days links, report any differences, compress all files except for the sdiff output, keep a month worth of daily history.
Sound like a nightmare??? It is. Here is what I have so far, but I am having a problem figuring out how to name/compare files....
Any help would be greatly appreciated!
LINKLOG=/funded/history
LINKTESTLOG=/test/history
FILEDATE=`date +%m%d%Y`
#Search all release versions within directory
for i in [4-9][0-9]/funded/test;
do
ll -R $i >> $LINKTESTLOG/testfile.log;
done
#
# Search funded directory.
for i in /funded;
do
ll -R $i >> $LINKLOG/rcsfile.log;
done
#Find all links and name using date to keep track
for i in $LINKTESTLOG/testfile.log
do
find. -type l print >$LINKTESTLOG/log.$FILEDATE
done
#Find all links and name using date to keep track
for i in $LINKLOG/rcsfile.log
do
find. -type l print >$LINKLOG/log.$FILEDATE
done
sdiff $LINKTESTLOG/log # HOW TO SDIFF previous day file to today file??
compress #ALL EXCEPT sdiffs
#Remove or save files as needed.
Any info as I said would be greatly appreciated.
Lisa