Skip to content

Commit c3193c1

Browse files
author
Chad Nelson
authored
Merge pull request #248 from tulibraries/fix-s3-mv-to-same-location
Skip moving s3 files when src and dest are equal.
2 parents 4485db6 + e3ba70c commit c3193c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cob_datapipeline/scripts/sc_ingest_marc.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,9 @@ do
2929
echo "Indexing file: "$file
3030
bundle exec cob_index $COMMAND $(aws s3 presign s3://$BUCKET/$file)
3131
processed_file=$(echo $file | sed 's/new-updated/processed-new-updated/' | sed 's/deleted/processed-deleted/')
32-
aws s3 mv s3://$BUCKET/$file s3://$BUCKET/$processed_file
32+
33+
# In full reindex context $file and $processed_file are equal.
34+
if [ "$file" != "$processed_file" ]; then
35+
aws s3 mv s3://$BUCKET/$file s3://$BUCKET/$processed_file
36+
fi
3337
done

0 commit comments

Comments
 (0)