MD5 sum check
Hey guys,
I have had this question answered before on this site, but like a dummy I did not save my script.
I'm trying to write a bash script that points to a file server to check for duplicate files. I have done some googling, but I see to be stuck on an if statement.
here is what I have so far:
"#!/bin/bash
#This is a script to find duplicate files using Md5sum
SRC_DIR=/directory/home/user/NOTES/
RESULT_FILE=/directory/home/home/checksum_result.txt
FAILURE=/directory/home/user/checksum_fail.txt
SUCCESS=/directory/home/user/checksum_win.txt
cd $SRC_DIR
find ./ -type f -exec md5sum {} \; > /directory/home/user/checksum.txt
md5sum -c < /directory/home/user/checksum.txt > $RESULT_FILE
if [ "$file1" != "$file2" ];
then"
This is where I get stuck.
" if [ "$file1" != "$file2" ]; "
I'm not entirely sure if the IF statement is correct. I want it to compare the checksum.txt file to the RESULTS file, then print the duplicates into a checksum_fail.txt file.
|