1
0
Fork 0
mirror of synced 2024-06-14 00:04:45 +12:00
bulk-downloader-for-reddit/scripts/extract_failed_ids.sh

24 lines
627 B
Bash
Raw Normal View History

2021-05-01 15:23:31 +12:00
#!/bin/bash
if [ -e "$1" ]; then
file="$1"
else
echo 'CANNOT FIND LOG FILE'
exit 1
fi
if [ -n "$2" ]; then
output="$2"
echo "Outputting IDs to $output"
else
2021-06-13 11:49:42 +12:00
output="./failed.txt"
2021-05-01 15:23:31 +12:00
fi
2021-05-18 15:58:07 +12:00
{
2021-05-21 19:02:43 +12:00
grep 'Could not download submission' "$file" | awk '{ print $12 }' | rev | cut -c 2- | rev ;
grep 'Failed to download resource' "$file" | awk '{ print $15 }' ;
grep 'failed to download submission' "$file" | awk '{ print $14 }' | rev | cut -c 2- | rev ;
2022-01-06 16:06:46 +13:00
grep 'Failed to write file' "$file" | awk '{ print $14 }' ;
2021-06-11 20:36:40 +12:00
grep 'skipped due to disabled module' "$file" | awk '{ print $9 }' ;
2021-05-18 15:58:07 +12:00
} >>"$output"