宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
查看: 11888|回复: 8

[疑问] 备份利器Google Drive,linux shell下可以使用软件分享

  [复制链接]
发表于 2016-1-20 12:33:34 | 显示全部楼层 |阅读模式
本帖最后由 yumin9822 于 2016-1-20 12:56 编辑

本文介绍都是我自己Linux下面shell可以使用的基于Google Drive API的第三方工具,他们分别是 Gdrive Drive Skicka以及google-drive-ocamlfuse,最后有一个多个云的综合管理软件 rclone.
相应的官方链接都在下面,后面会展开具体本人的使用心得。本文未涉及具体使用,只汇总和分享了心得。具体使用请参考官方网站。
https://github.com/prasmussen/gdrive
https://github.com/odeke-em/drive
https://github.com/google/skicka
https://github.com/astrada/google-drive-ocamlfuse
https://github.com/ncw/rclone

google drive 单文件大小限制 5Tb  oh my  god!  本人测试了28G的单文件没问题!
https://support.google.com/drive/answer/37603?hl=en
Up to 5 TB for files uploaded but not converted to Google Docs, Sheets, or Slides

===============================
Gdrive 篇

https://github.com/prasmussen/gdrive
基于Go语言编写的,我已经直接编译好了binary可以供大家下载,地址如下:
https://dl.dropboxusercontent.com/u/12792294/vps/bin/gdrive-linux-x64
https://dl.dropboxusercontent.com/u/12792294/vps/bin/gdrive-linux-386
https://dl.dropboxusercontent.com/u/12792294/vps/bin/gdrive-linux-arm

适合单个文件或者目录上传,缺点:上传不能上传到特定目录,只能放到根目录。
最大的特点是:上传和下载都支持stdin stdout。stdin stdout是标准输入和标准输出,Linux下面支持管道的就可以受用这一点。本文里面只有该命令支持stdin stdout
例如:配合支持管道的命令如wget可以实现一半从第三方下载,一边上传到Google Drive。不需要本地下载全部再上传!(应用场景就是:VPS硬盘小,你可以通过管道从第三方站点下载大文件,然后转存到Google Drive)
这里以从百度下载一个侠盗飞车的游戏为例。注意这里Gdrive命令一定要加 -t 选项,即指定文件名。
  1. wget -O- http://dlsw.baidu.com/sw-search-sp/soft/19/17560/xdlcs_zeds1.0.0.0.1443093073.exe | gdrive upload -s -t xdlcs_zeds1.0.0.0.1443093073.exe
复制代码


具体编译和使用可以参考官方网站

作为唯一支持stdin stdout的命令,推荐使用
===============================
Drive 篇

https://github.com/odeke-em/drive

同样基于Go语言编写的,我已经直接编译好了binary可以供大家下载,地址如下:
https://dl.dropboxusercontent.com/u/12792294/vps/bin/drive_amd64
https://dl.dropboxusercontent.com/u/12792294/vps/bin/drive_i386

适合同步一个文件夹之类的,drive push pull之类。特别适合备份目录啥的。半个同步工具
但是不太适合上传单个文件之类的。

因为没什么特长之处,不推荐使用
===============================
skicka 篇
https://github.com/google/skicka

同样基于Go语言编写的,我已经直接编译好了binary可以供大家下载,地址如下:
https://dl.dropboxusercontent.com/u/12792294/vps/bin/skicka_amd64
https://dl.dropboxusercontent.com/u/12792294/vps/bin/skicka_i386

直接下载binary需要运行下面
touch /root/.skicka.config
chmod 600 /root/.skicka.config

很好用的一个程序,可以upload download还支持加密。支持远程list rename mkdir之类的操作,就像本地命令一样。管理很方便。

下面是我使用的截图
DO VPS新加坡机房上传到google drive速度在5-10MB/S之间

软件细微之处做的很棒,强力推荐
===============================
google-drive-ocamlfuse 篇
https://github.com/astrada/google-drive-ocamlfuse

这个厉害了,直接将google drive映射为本地的一个目录使用,但是也是安装最麻烦的一个,实测大文件操作效率低。

网上有人折腾,http://blog.zorangagic.com/2014/07/mount-google-drive-on-linux-google.html
系统OS推荐使用Ubuntu,本人测试成功。centos测试安装失败。
Linode官方也有指导文章如下:
安装前请安装 apt-get install software-properties-common
https://www.linode.com/docs/applications/cloud-storage/access-google-drive-linode

推荐需要折腾的人尝试
===============================
Rclone 篇
https://github.com/ncw/rclone
http://rclone.org/

这是一个跨服务商的多个云的同步软件,非常强大,官方有详细使用说明。
特长支持:支持云端copy。conoha object storage也支持。

官方提供编译好的binary下载:http://rclone.org/downloads/

支持云有如下:
Google Drive
Amazon S3
Openstack Swift / Rackspace cloud files / Memset Memstore
Dropbox
Google Cloud Storage
Amazon Cloud Drive
Microsoft One Drive
Hubic
Backblaze B2
Yandex Disk
The local filesystem

推荐需要跨云端管理的用户使用
===============================

其他的软件还有,一起放在这里
https://github.com/vitalif/grive2
https://github.com/MasterSoft24/Grive2
https://github.com/dsoprea/GDriveFS
https://github.com/thejinx0r/node-gdrive-fuse

===============================
Host web pages with Google Drive
Announcement: This will be deprecated August 31, 2015
On August 31, 2015, web hosting in Google Drive will be deprecated. You can continue to use this feature until August 31st, 2016, but after that, googledrive.com/host/ID will no longer work.

Find a new website host using Google Domains
Learn more about why this is being deprecated
How to publish web pages using Google Drive
You can make web resources — like HTML, CSS, and Javascript files — viewable as a website using Google Drive. Note that we do not support web resources that use server-side scripting languages, like PHP.

Go to drive.google.com.
Select a file.
At the top, click the Share button.
At the bottom right of the sharing box, click Advanced.
Click Change....
Click On - Public on the web > Save.
Before closing the sharing box, copy the document ID from the URL in the field below "Link to share." The document ID is made up of uppercase letters, lowercase letters, and numbers between slashes in the URL.
Share the URL that looks like "www.googledrive.com/host/[doc id]" where [doc id] is replaced by the document ID you copied. Anyone can now view your webpage.
比如你获取的文件id是 0B7HCXITuRwAzSUc5aTJVZFpuMzg 则直链就是下面,
http://www.googledrive.com/host/0B7HCXITuRwAzSUc5aTJVZFpuMzg
支持目录,样例如下:
http://www.googledrive.com/host/0B7HCXITuRwAzQVdCN2FBVWxkNnM
===============================
Last but not least, 让我们一起把Google Edu版账号得威力发挥出来

评分

参与人数 2威望 +50 收起 理由
我是人 + 25 赞两个!
欧阳逍遥 + 25 赞一个!

查看全部评分

suzizi 该用户已被删除
发表于 2016-1-20 12:38:49 来自手机 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2016-1-20 12:40:38 | 显示全部楼层
我是司机,开google的
发表于 2016-1-20 12:45:38 | 显示全部楼层
google edu怎么搞
 楼主| 发表于 2016-1-20 12:48:14 | 显示全部楼层

可以自己申请edu域名然后申请google edu版。
本人也出售美国大学 .edu信箱,可以直接使用gmail 和无限容量google drive
发表于 2016-1-20 15:20:37 | 显示全部楼层
yumin9822 发表于 2016-1-20 04:48
可以自己申请edu域名然后申请google edu版。
本人也出售美国大学 .edu信箱,可以直接使用gmail 和无限容 ...

报价吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|FastFib VPS论坛

GMT+8, 2024-9-20 16:38 , Processed in 0.085507 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表