It almost sounds to me like there is another problem at hand, if you're having file corruption on an FTP transfer. Can you post the relevant parts of your code? The first idea that occurred to me was to have the system, on which the files live, create textfiles which simply holds the md5 sum of the files that are to be transferred..
In two bash scripts, the first "finder.sh":
Code:
#!/bin/bash
# finder.sh
md5er=./md5check.sh
path=./
find $path -type f -exec $md5er {} \;
and the second, md5check.sh:
Code:
#!/bin/bash
# md5check.sh
if [ -z "$1" ]; then
echo "$0: No filename provided"
exit
fi
if [ ! -e "$1" ]; then
echo "$0: Not a legitimate filename"
exit
fi
if [ -e "$1.md5" ]; then
existing=`cat "$1.md5"`
new=`md5sum "$1" | awk '{print $1;}'`
if [ "$existing" = "$new" ]; then
# they match, no need to redo it
exit
fi
fi
md5sum "$1" | awk '{print $1;}' > "$1.md5"
Basically these two scripts just recurse a dir tree (given in finder.sh), and see if md5 sum files of the files exist, and if so makes sure they are up to date..
Then, your script can retrieve the files and the md5 files via FTP, and use the sum in the .md5 files to check against the files tranferred.
Like I said, this was my first thought.. there might be a better/another way to go about it.. (=