Hey
im working on script that can compare 2 directory and check difference, then copy difference files in third diretory.
here is the story:
in folder one we have 12 subfolder and in each of them near 500 images hosted.
01 02 03 04 05 06 07 08 09 10 11 12
in folder 2 we have same subfolder but maybe diffrence images like in folder 2, subfolder 07 maybe image 45 is deleted so we need backup of it,
ive write this script:
f1=""
f2=""
des=""
for x in `rsync -rcnC --out-format="%n" $f1 $f2`
do
if [ -d "$f1/$x" ];
then
mkdir -p "$des/$x"
else
cp -frv $f1/$x $des/$x
fi
done
also i try to use diff
command but script eat ram and cpu. im looking for alternative method, is there any ?