作为一个非官方的Google Drive 客户端Grive2是一个简单的Linux客户端应用程序,只需下载您的Google Drive中的所有文件到当前目录。你以后本地修改文件,再次运行Grive,它就会上传更改回你的Google Drive。
几个特点
New files created locally or in Google Drive will be uploaded or downloaded respectively
Deleted files will also be “removed”
Currently Grive will NOT destroy any of your files: it will only move the files to a directory named .trash or put them in the Google Drive trash
You can always recover them.
There are a few things that Grive does not do at the moment:
continously wait for changes in file system or in Google Drive to occur and upload. A sync is only performed when you run Grive.
symbolic links support.
support for Google documents.
Grive2 0.5.1 亮点:
no-remote-new and upload-only modes
ignore regexp does not persist anymore (note that Grive will still track it to not accidentally delete remote files when changing ignore regexp)
added options to limit upload and download speed
Ubuntu 16.04 (Xenial Xerus), Ubuntu 15.10 (Wily Werewolf), Ubuntu 15.04(Vivid Vervet), Ubuntu 14.04 (Trusty Tahr) 安装 Grive2 0.5.1
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install grive
要查看Grive命令的可用选项的所有列表,执行:
sudo grive --help
输出示例:
linuxidc@linuxidc:~$ sudo grive --help
Grive options:
-h [ --help ] Produce help message
-v [ --version ] Display Grive version
-a [ --auth ] Request authorization token
-p [ --path ] arg Path to sync
-s [ --dir ] arg Subdirectory to sync
-V [ --verbose ] Verbose mode. Enable more messages than normal.
--log-xml Log more HTTP responses as XML for debugging.
--new-rev Create new revisions in server for updated files.
-d [ --debug ] Enable debug level messages. Implies -v.
-l [ --log ] arg Set log output filename.
-f [ --force ] Force grive to always download a file from Google Drive
instead of uploading it.
--dry-run Only detect which files need to be uploaded/downloaded,
without actually performing them.
在您的本地系统中创建一个下载/上传文件夹(再同步)。
linuxidc@linuxidc:~$ mkdir /home/linuxidc/sync
进入新创建的“同步”的目录。
linuxidc@linuxidc:~$ cd sync/
首次运行下面的命令。
linuxidc@linuxidc:~/sync$ grive -a
上面的命令将显示一个URL。
-----------------------
Please go to this URL and get an authentication code:
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2F%2Fauth%2Fuserinfo.email+https%3A%2F%2F%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fdocs.google.com%2Ffeeds%2F+https%3A%2F%2Fdocs.googleusercontent.com%2F+https%3A%2F%2Fspreadsheets.google.com%2Ffeeds%2F&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&client_id=22314510474.apps.googleusercontent.com
-----------------------
Please input the authentication code here: