Skip to content

Commit

Permalink
using sshpass to upload because curl no longer working for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
explodecomputer committed Jan 16, 2025
1 parent 349dda6 commit f172a2e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Binary file added bin/sshpass
Binary file not shown.
2 changes: 1 addition & 1 deletion utils/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if [[ $step = "00" ]];
then
cp config.env ${results_dir}/00
cp ${genotype_input_list} ${results_dir}/00
cp ${genptype_processed_dir}/scratch/indep.bim ${results_dir}/00
cp ${genotype_processed_dir}/scratch/indep.bim ${results_dir}/00
fi

tar -czvf ${results_dir}/${cohort_name}_$step.tar.gz -C ${results_dir} $step
Expand Down
14 changes: 11 additions & 3 deletions utils/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ cd ${results_dir}
md5sum -c ${cohort_name}_${step}.tar.gz.md5

sftp_address="lcgwassftp.blob.core.windows.net"
sftp_username_full="lcgwassftp.analysts.${sftp_username}"
sftp_username_full="lcgwassftp.testcontainer.${sftp_username}"

read -s -p "Ready to upload? Press enter to continue: " anykey
echo ""
read -s -p "Enter SFTP password: " mypassword

curl -1 -v -k "sftp://${sftp_address}/${sftp_username}/${cohort_name}_${step}.tar.gz" --user "${sftp_username_full}:${mypassword}" -T "${results_dir}/${cohort_name}_${step}.tar.gz"
curl -1 -v -k "sftp://${sftp_address}/${sftp_username}/${cohort_name}_${step}.tar.gz.md5" --user "${sftp_username_full}:${mypassword}" -T "${results_dir}/${cohort_name}_${step}.tar.gz.md5"
export SSHPASS=$mypassword
${d}/bin/sshpass -e sftp -oBatchMode=no -b - ${sftp_username_full}@${sftp_address} << !
put ${results_dir}/${cohort_name}_${step}.tar.gz
put ${results_dir}/${cohort_name}_${step}.tar.gz.md5
bye
!

# This used to work and now doesn't - need to figure it out
# curl -1 -v -k "sftp://${sftp_address}:22/${sftp_username}/${cohort_name}_${step}.tar.gz" --user "${sftp_username_full}:${mypassword}" -T "${results_dir}/${cohort_name}_${step}.tar.gz"
# curl -1 -v -k "sftp://${sftp_address}:22/${sftp_username}/${cohort_name}_${step}.tar.gz.md5" --user "${sftp_username_full}:${mypassword}" -T "${results_dir}/${cohort_name}_${step}.tar.gz.md5"

echo "Successfully uploaded ${cohort_name}_${step}.tar.gz and ${cohort_name}_${step}.tar.gz.md5. Many thanks indeed!"

0 comments on commit f172a2e

Please sign in to comment.