微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ubuntu linux下使用google drive

起因

由于使用ubuntu14.04 系统,不方便使用百度网盘,又把把重要的文件备份到网盘中,使用google drive比较方便。

方法

有很多像 Grive2 这样的工具,以及更容易使用的以 Ocaml 语言编写的基于 FUSE 的文件系统。我将会用后面这种方式演示如何在 Linux 桌面上挂载你的 Google Drive。尽管这是通过命令行完成的,但是它的用法会简单到让你吃惊。它太简单了以至于谁都能做到。

这个系统的特点:

  • 对普通文件/文件夹有完全的读写权限
  • 对于 Google Docs,sheets,slides 这三个应用只读
  • 能够访问 Drive 回收站(.trash)
  • 能够访问 Drive 回收站(.trash)
  • 处理重复文件功能
  • 支持多个帐号

安装

1.用命令添加必要的 PPA

sudo add-apt-repository ppa:alessandro-sTrada/ppa

2.出现提示的时候,输入你的 root 密码并按下回车。
用命令更新应用

sudo apt-get update

3.用命令安装软件

sudo apt-get install google-drive-ocamlfuse

授权

接下来就是授权 google-drive-ocamlfuse,让它有权限访问你的 Google 账户。先回到终端窗口敲下命令

#proxychains 是使用代理,否则无法访问google
proxychains google-drive-ocamlfuse

这个命令将会打开一个浏览器窗口,它会提示你登陆你的 Google 帐号或者如果你已经登陆了 Google 帐号,它会询问是否允许 google-drive-ocamlfuse 访问 Google 账户。如果你还没有登录,先登录然后点击“允许”。接下来的窗口将会询问你是否授给 gdfuse 和 OAuth2 Endpoint 访问你的 Google 账户的权限,再次点击“允许”。然后出现的窗口就会告诉你等待授权令牌下载完成,这个时候就能最小化浏览器了。当令牌下载完了,并且你已经可以挂载 Google Drive 了。

ProxyChains-3.1 (http://proxychains.sf.net)
|DNS-request| gd-ocaml-auth.appspot.com 
|D-chain|-<>-127.0.0.1:1080-<><>-4.2.2.2:53-<><>-OK

(firefox:22900): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::sm-connect after class was initialised

(firefox:22900): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::show-crash-dialog after class was initialised

(firefox:22900): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after class was initialised

(firefox:22900): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::default-icon after class was initialised
|DNS-response|: gd-ocaml-auth.appspot.com does not exist
|DNS-request| gd-ocaml-auth.appspot.com 
|D-chain|-<>-127.0.0.1:1080-<><>-4.2.2.2:53-<><>-OK
|DNS-response| gd-ocaml-auth.appspot.com is 216.58.216.52
|D-chain|-<>-127.0.0.1:1080-<><>-216.58.216.52:443-<><>-OK
|D-chain|-<>-127.0.0.1:1080-<><>-127.0.0.1:1080-<><>-OK
**Access token retrieved correctly.**

挂载google drive

# 创建挂载目录
mkdir ~/google-drive

# 挂载google网盘
# 前面必须加proxychains命令使用代理,否则无法访问google
proxychains google-drive-ocamlfuse ~/google-drive

御载google drive文件

fusermount -u ~/google-drive

之后就可自由的向~/google-drive拷贝文件自动同步到goole drive网盘中。

原文地址:https://www.jb51.cc/ubuntu/353808.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐