Quantcast
Channel: 簡睿隨筆
Viewing all articles
Browse latest Browse all 897

Dropbox與GoogleDrive的命令行工具

$
0
0

有時雲端硬碟的同步軟體很方便,但如果你的硬碟空間很大而又不想全部下載到本地硬碟裡來佔空間,或需要對雲端檔案做自動化操作時,命令行指令就有很大的功用。本文將介紹Dropbox與Google Drive的命令行工具。

Dropbox命令行上傳工具:PneumaticTube

  -f, --file          Required. The location of the file to upload
  -p, --path          Required. The destination path in Dropbox
  -r, --reset         Force PneumaticTube to re-authorize with Dropbox
  -b, --bytes         Display progress in bytes instead of percentage when
                      using chunked uploading
  -c, --chunked       Force chunked uploading
  -q, --quiet         Suppress all output
  -n, --noprogress    Suppress progress output when using chunked uploading
  • 範例如下。第一次執行時會自動切換到瀏覽器的Dropbox授權網頁:
d:\DL\PneumaticTube-master>PneumaticTube.exe -f d:\dl\PneumaticTube.zip -p /temp -b
You'll need to authorize this account with PneumaticTube; a browser window will now open asking you to log into Dropbox and allow the app. When you've done that, hit Enter.

Uploading PneumaticTube.zip to /temp
Ctrl-C to cancel
Whoosh...
Uploaded PneumaticTube.zip to /temp/PneumaticTube.zip; Revision 4185835

GoogleDrive上傳/下載命令行工具:gdrive

範例1. 列出檔案以取得檔案ID:

d:\DL>drive-windows-x64.exe list -t ditto*.exe
Id                             Title                            Size     Created

0B_dE90dinOFDcFE0aEFvWktvM1E   Ditto.exe                        1.9 MB   2014-06-09 20:
19:47
0B_dE90dinOFDTU1ucFF4bE9yQnc   DittoSetup_64bit_3_18_46_0.exe   3.6 MB   2014-06-09 12:
08:50

範例2. 下載檔案

d:\DL>drive-windows-x64 download -i 0B_dE90dinOFDcFE0aEFvWktvM1E
Downloaded 'Ditto.exe' at 1.9 MB/s, total 1.9 MB

範例3. 取得檔案的網址

d:\DL>drive-windows-x64 url -i 0B_dE90dinOFDcFE0aEFvWktvM1E
https://drive.google.com/uc?id=0B_dE90dinOFDcFE0aEFvWktvM1E

請參考官方上的更多範例。

##

您可能也會有興趣的類似文章


Viewing all articles
Browse latest Browse all 897

Trending Articles