print_summary.sh 643 B

12345678910111213141516
  1. #!/bin/bash
  2. if [ -e "$1" ]; then
  3. file="$1"
  4. else
  5. echo 'CANNOT FIND LOG FILE'
  6. exit 1
  7. fi
  8. echo "Downloaded submissions: $( grep -c 'Downloaded submission' "$file" )"
  9. echo "Failed downloads: $( grep -c 'failed to download submission' "$file" )"
  10. echo "Files already downloaded: $( grep -c 'already exists, continuing' "$file" )"
  11. echo "Hard linked submissions: $( grep -c 'Hard link made' "$file" )"
  12. echo "Excluded submissions: $( grep -c 'in exclusion list' "$file" )"
  13. echo "Files with existing hash skipped: $( grep -c 'downloaded elsewhere' "$file" )"
  14. echo "Submissions from excluded subreddits: $( grep -c 'in skip list' "$file" )"