Forked from jemygraw/all_in_one_batch_upload_mac.sh
Last active
August 29, 2015 14:16
-
-
Save forrest-mao/958260f13aa4e82302e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
gecho -e "curl\tqboxrsctl" | |
#set variables | |
uploadFile="/Users/jemy/Documents/qiniu.png" | |
uploadHost="up.qiniu.com" | |
uploadToken="ELUs327kxVPJrGCXqWae9yioc0xYZyrIpbM6Wh6o:YEZCdEInhP2a-4Whb_D23nPl6b4=:eyJzY29wZSI6ImlmLXBibCIsImRlYWRsaW5lIjoxNDIyMDkxOTk3fQ==" | |
uploadBucket="if-pbl" | |
uploadTimes=1000 | |
curlPrefix="curl_1277431" | |
qboxPrefix="qbox_1277431" | |
for((i=1;i<=$uploadTimes;i++));do | |
#curl | |
startTime=$(gdate +%s.%N) | |
curl --silent -F "key=${curlPrefix}_${i}" -F "token=$uploadToken" -F "file=@$uploadFile" $uploadHost > /dev/null | |
endTime=$(gdate +%s.%N) | |
curlLastTime=$(gecho "$endTime-$startTime"|bc -l) | |
#qboxrsctl | |
startTime=$(gdate +%s.%N) | |
qboxrsctl put $uploadBucket $qboxPrefix"_${i}" $uploadFile > /dev/null | |
endTime=$(gdate +%s.%N) | |
qboxLastTime=$(gecho "$endTime-$startTime"|bc -l) | |
gecho -e $curlLastTime "\t" $qboxLastTime | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment