Rework on the pull request to refactor the new code
This commit is contained in:
parent
6f5b0dccc8
commit
2e6e383538
1 changed files with 18 additions and 21 deletions
|
|
@ -372,22 +372,19 @@ get_source_file_size()
|
||||||
DUEXCLIST="${DUEXCLIST}${exclude}\n"
|
DUEXCLIST="${DUEXCLIST}${exclude}\n"
|
||||||
done
|
done
|
||||||
|
|
||||||
# if $INCLIST non zero then itterate through it for du -hs readings, else just du -hs $ROOT
|
# if INCLIST is not set or empty, add ROOT to it to be able to calculate disk usage
|
||||||
# in both cases consider the excluded directories
|
|
||||||
if [ ! -z "$INCLIST" ]; then
|
if [ ! -z "$INCLIST" ]; then
|
||||||
for include in ${INCLIST[@]}
|
DUINCLIST=($ROOT)
|
||||||
do
|
else
|
||||||
|
DUINCLIST=$INCLIST
|
||||||
|
fi
|
||||||
|
|
||||||
|
for include in ${DUINCLIST[@]}; do
|
||||||
echo -e "$DUEXCLIST" | \
|
echo -e "$DUEXCLIST" | \
|
||||||
du -hs ${DUEXCFLAG} ${include} | \
|
du -hs ${DUEXCFLAG} ${include} | \
|
||||||
awk '{ FS="\t"; $0=$0; print $1"\t"$2 }' \
|
awk '{ FS="\t"; $0=$0; print $1"\t"$2 }' \
|
||||||
>> ${LOGFILE}
|
>> ${LOGFILE}
|
||||||
done
|
done
|
||||||
else
|
|
||||||
echo -e "$DUEXCLIST" | \
|
|
||||||
du -hs ${DUEXCFLAG} $ROOT | \
|
|
||||||
awk '{ FS="\t"; $0=$0; print $1"\t"$2 }' \
|
|
||||||
>> ${LOGFILE}
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo >> ${LOGFILE}
|
echo >> ${LOGFILE}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue