Skip to content

Commit

Permalink
add more logs; fix rclone copy command
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Oct 22, 2024
1 parent 30b1fae commit bab4c61
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/digifeeds/upload_to_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,32 @@ main() {

log_info "Copying $barcode"

log_info "Zipping $barcode"
zip_it $input_directory/$barcode
if [[ $? != 0 ]]; then
log_error "Failed to zip $barcode"
errors_total=$((errors_total + 1))
continue
fi

log_info "Verifying zip of $barcode"
verify_zip $input_directory/$barcode
if [[ $? != 0 ]]; then
log_error "$barcode.zip does not contain the correct files"
errors_total=$((errors_total + 1))
continue
fi


rclone copy $input_directory/$barcode.zip $digifeeds_bucket:$barcode.zip
log_info "Sending $barcode to S3"
rclone copy $input_directory/$barcode.zip $digifeeds_bucket:
if [[ $? != 0 ]]; then
log_error "Failed to copy $barcode"
upload_errors_total=$((upload_errors_total + 1))
errors_total=$((errors_total + 1))
continue
fi

log_info "Verifying barcode in S3"
rclone check $input_directory/$barcode.zip $digifeeds_bucket:
if [[ $? != 0 ]]; then
log_error "$barcode not found in S3"
Expand Down

0 comments on commit bab4c61

Please sign in to comment.