#!/bin/bash
# Script to evaluate nb of inodes which will be created on store and work

NB1=0; NB2=0; SOMME=0; RESULTAT=0;

# nb de listes dans output_ncrcat output_tar debug_tar restart_tar
NB1=$( find $TMP_MIGR_DATA/IGCM_DEM -type f -name "*.list" | wc -l )
# nb de fichiers dans les listes store_cp
find $TMP_MIGR_DATA/IGCM_DEM -type f -name "*.list" | grep "store_cp" > tmp.$$
for list in `cat tmp.$$` ; do
for dir in `cat $list` ; do
NB2=$( find $dir | wc -l )
(( SOMME = SOMME + NB2 ))
done
done
# somme des 2
(( RESULTAT = NB1 + SOMME ))
echo store
echo $RESULTAT
rm -f tmp.$$

# nb de fichiers dans les listes work_cp 
NB2=0; SOMME=0; RESULTAT=0;
find $TMP_MIGR_DATA/IGCM_DEM -type f -name "*.list" | grep "work_cp" > tmp.$$
for list in `cat tmp.$$` ; do
for dir in `cat $list` ; do
NB2=$( find $dir | wc -l )
(( SOMME = SOMME + NB2 ))
done
done
echo work
echo $SOMME
rm -f tmp.$$

