1. 程式人生 > >七牛雲 mac qshell 下載資源和上傳資源

七牛雲 mac qshell 下載資源和上傳資源

開發十年,就只剩下這套架構體系了! >>>   

應用背景: 我現在有兩個七牛雲賬號 A,B,現在需要把A裡面的一個儲存A-1(公共儲存)遷移到B裡面的一個儲存B-1(私有儲存),已知A-1儲存量=19G .面對19G的資料選擇qshell 工具來把A-1資料轉化到B-1

下載和配置qshell

  1. qshell 下載,下載後的檔案並解壓,把檔案裡面的 qshell_darwin_x64 複製出來並且改名為"qshell"(方便接下來的路勁引用),檔案路徑為:/Users/lph/qshell
  2. 建立用來接收下載的檔案backup 路勁為:/Users/lph/qshell/backup
  3. 建立下載的配置檔案qdownload 內容為:
    {
        "dest_dir"   :   "/Users/lph/qshell/backup", #指定下載到的檔案位置
        "bucket"     :   "XXX(檢視七牛雲具體的儲存bucket)",
        "prefix"     :   "",
        "suffixes"   :   ".png,.jpg"
    }
    

     

  4. mac 配置 qshell 指令 
    $ vi ~/.bash_profile
    ....
    export PATH="/Users/lph/qshell" #載入qshell命令
    .....
    
    $ source ~/.bash_profile
    
    $ qshell #配置成功
    Qiniu commandline tool for managing your bucket and CDN
    
    Usage:
      qshell [command]
    
    Available Commands:
      account       Get/Set AccessKey and SecretKey
      alilistbucket List all the file in the bucket of aliyun oss by prefix
      b64decode     Base64 Decode, default nor url safe
      b64encode     Base64 Encode, default not url safe
      batchchgm     Batch change the mime type of files in bucket
      batchchtype   Batch change the file type of files in bucket
      batchcopy     Batch copy files from bucket to b
    .........

下載七牛雲檔案

開啟cmd 輸入命令:

$  qshell account 七牛雲的ACCESSKEY 七牛雲的SECRETKEY 你的賬號名稱   #賬號配置
$ qshell qdownload 15 qdownload  #下載檔案 最大併發為15 下載內容根據qdownload 檔案

下載19G 需要下載2個小時,但願世界和平同事不要因為網速被下載的太慢而砍我.



 上傳七牛雲檔案

$ qshell qupload2 --src-dir=/Users/lph/qshell/backup --bucket=bucket名稱

19G上傳的時間要多久 只能問上行速度了 , 工單問過不支援續傳 只求神獸保佑了