Created
May 14, 2013 16:55
-
-
Save leipzig/5577536 to your computer and use it in GitHub Desktop.
Expect script for Aspera uploads for use when the server chokes on wildcards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
#Upload a file to an Aspera server, filling in the passphrase field | |
#Usage: ./autopass.sh mybigassfile | |
set arg1 [lindex $argv 0] | |
set timeout -1 | |
spawn ascp -i sra-rsakey-putty.ppk -k 1 -Qr -l300M $arg1 [email protected]:protected/ | |
expect "Passphrase for key \"rsa-key-blahblah\":" | |
send "mypassword\r" | |
expect "Completed" | |
#add the file you successfully uploaded to a log | |
set filelog [open uploadedfiles.txt a] | |
puts $filelog $arg1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is best paired with a "screen" session, so as to prevent a local disconnection from killing the job (like nohup but more easily revisited):
ctrl-a then d to leave the screen and go about your business
screen -dR dbgap to revisit