PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1#!/bin/bash
 2
 3# This script can create a folder under aspera directory according to
 4# user's name, then send confirmation emails to both the user and
 5# cistrome admin team.
 6
 7if [ $# -lt 2 ]; then
 8    echo "need 1 para: <username> <this week password>!"
 9    exit
10fi
11
12# Modify these according to your server
13# ASPERA directory path on server
14ASPERA_DIR=/data/CistromeAP/ap_lib/ftp
15# ASPERA user name
16ASPERA_USER=cistromeap
17# ASPERA host name
18ASPERA_HOST=cistrome.org
19# ASPERA web interface URL
20ASPERA_WEB=http://cistrome.org/aspera/user
21# cistrome contact email address, a notification email will be BCCed to this email address
22CISTROME_CONTACT=cistrome-bugs@jimmy.harvard.edu
23# cistrome bugs email address, we will suggest users in the mail body to send questions/feedbacks to this email address.
24CISTROME_BUGS=cistrome-bugs@jimmy.harvard.edu
25
26# create folder for cistrome user under aspera path
27
28mkdir ${ASPERA_DIR}/${1}
29chown -R ${ASPERA_USER} ${ASPERA_DIR}/${1}
30
31# send email to both admin and user
32
33sendmail ${1} ${CISTROME_CONTACT} <<EOF
34From: ${USER}@${ASPERA_HOST}
35Subject: [cistrome] Your ASPERA upload directory is ready to use. (Do Not Reply)
36To: ${1}
37BCC: ${CISTROME_CONTACT}
38Hi ${1},
39
40Please login the web interface <${ASPERA_WEB}/?B=%2F${1}> with:
41
42username: ${ASPERA_USER}
43password: ${2}
44
45If you know how to use command 'ascp' in terminal, you can also do:
46
47ascp -P 33001 someLocalFile.bam ${ASPERA_USER}@${ASPERA_HOST}:/${1}/
48
49After upload, you will see the file in the 'Upload file' window in CistromeAP site. 
50
51If you have any question, please send email to ${CISTROME_BUGS}. Please do not reply to this email.
52
53Best,
54Cistrome Dev Team
55
56--This email was sent by sendmail--
57
58EOF
59