File size: 707 Bytes
d382f84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
echo "Repository file stats:"
total_files=0
total_mb=0
for dir in _indonesia_* indonesia_*; do
    if [ -d "$dir" ]; then
        file_count=$(git lfs ls-files -n | grep "$dir/raw" | wc -l)
        total_files=$((total_files + file_count))
        dir_mb=$(du -sh $(git lfs ls-files -n | grep "$dir/raw") 2>/dev/null | awk '{total += $1} END {print total}')
        total_mb=$(echo "$total_mb + $dir_mb" | bc)
        dir_gb=$(echo "scale=2; $dir_mb/1024" | bc)
        echo "$dir: $file_count files, ${dir_gb}GB total"
    fi
done
total_gb=$(echo "scale=2; $total_mb/1024" | bc)
echo "----------------------------------------"
echo "TOTAL: $total_files files, ${total_gb}GB total"
echo "Done!"