Homyar Bhathena wrote:
> Is it possible to write a shell script to extract the number of files
added
> in a particular directory in a specific time duration (lets say last 2
> hours) and then dtermine how many combinations have the same file size and
> based on that, do a file compare for the extracted files having same file
> size.
You could write a simple shell script, or use perl. Look at curl and diff.
I am not sure what comparing by file sizes will give you. Would'nt you
rather do a md5sum check?
Something like this:
# compare file checksums
md5new=`md5 -q $NEW_FILE`
md5old=`md5 -q $LIST_FILE`
if [ $md5old = $md5new ]
then
# files are same, exit
exit 0
fi
# files differ, mv new to old text list file
mv -f $NEW_FILE $LIST_FILE