From 7c27b7bf127b38b8c8f020ef5a645836b33fc41a Mon Sep 17 00:00:00 2001 From: Serene-Arc Date: Sun, 13 Jun 2021 09:49:42 +1000 Subject: [PATCH] Update logging message --- bdfr/downloader.py | 2 +- scripts/extract_failed_ids.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bdfr/downloader.py b/bdfr/downloader.py index a0d8834..ab6bf56 100644 --- a/bdfr/downloader.py +++ b/bdfr/downloader.py @@ -103,7 +103,7 @@ class RedditDownloader(RedditConnector): logger.debug(f'Written file to {destination}') except OSError as e: logger.exception(e) - logger.error(f'Failed to write file to {destination} in submission {submission.id}: {e}') + logger.error(f'Failed to write file in submission {submission.id} to {destination}: {e}') return creation_time = time.mktime(datetime.fromtimestamp(submission.created_utc).timetuple()) os.utime(destination, (creation_time, creation_time)) diff --git a/scripts/extract_failed_ids.sh b/scripts/extract_failed_ids.sh index 104c7af..f96bd9a 100755 --- a/scripts/extract_failed_ids.sh +++ b/scripts/extract_failed_ids.sh @@ -11,13 +11,13 @@ if [ -n "$2" ]; then output="$2" echo "Outputting IDs to $output" else - output="failed.txt" + output="./failed.txt" fi { 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 ; - grep 'Failed to write file' "$file" | awk '{ print $16 }' | rev | cut -c 2- | rev ; + grep 'Failed to write file' "$file" | awk '{ print $13 }' | rev | cut -c 2- | rev ; grep 'skipped due to disabled module' "$file" | awk '{ print $9 }' ; } >>"$output"