/cistromescripts/create_aspera_accounts.sh
https://bitbucket.org/cistrome/cistrome-harvard/ · Shell · 59 lines · 29 code · 17 blank · 13 comment · 1 complexity · 1805c42489e47df75eebb1aedfa39aaa MD5 · raw file
- #!/bin/bash
- # This script can create a folder under aspera directory according to
- # user's name, then send confirmation emails to both the user and
- # cistrome admin team.
- if [ $# -lt 2 ]; then
- echo "need 1 para: <username> <this week password>!"
- exit
- fi
- # Modify these according to your server
- # ASPERA directory path on server
- ASPERA_DIR=/data/CistromeAP/ap_lib/ftp
- # ASPERA user name
- ASPERA_USER=cistromeap
- # ASPERA host name
- ASPERA_HOST=cistrome.org
- # ASPERA web interface URL
- ASPERA_WEB=http://cistrome.org/aspera/user
- # cistrome contact email address, a notification email will be BCCed to this email address
- CISTROME_CONTACT=cistrome-bugs@jimmy.harvard.edu
- # cistrome bugs email address, we will suggest users in the mail body to send questions/feedbacks to this email address.
- CISTROME_BUGS=cistrome-bugs@jimmy.harvard.edu
- # create folder for cistrome user under aspera path
- mkdir ${ASPERA_DIR}/${1}
- chown -R ${ASPERA_USER} ${ASPERA_DIR}/${1}
- # send email to both admin and user
- sendmail ${1} ${CISTROME_CONTACT} <<EOF
- From: ${USER}@${ASPERA_HOST}
- Subject: [cistrome] Your ASPERA upload directory is ready to use. (Do Not Reply)
- To: ${1}
- BCC: ${CISTROME_CONTACT}
- Hi ${1},
- Please login the web interface <${ASPERA_WEB}/?B=%2F${1}> with:
- username: ${ASPERA_USER}
- password: ${2}
- If you know how to use command 'ascp' in terminal, you can also do:
- ascp -P 33001 someLocalFile.bam ${ASPERA_USER}@${ASPERA_HOST}:/${1}/
- After upload, you will see the file in the 'Upload file' window in CistromeAP site.
- If you have any question, please send email to ${CISTROME_BUGS}. Please do not reply to this email.
- Best,
- Cistrome Dev Team
- --This email was sent by sendmail--
- EOF