Quantcast
Channel: 看得透又看得远者prevail. ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
Viewing all articles
Browse latest Browse all 20530

使用 rclone 将文件同步至 Google Drive

$
0
0
下面开始讲 rclone 安装和同步方法, 首先 Google Dirve 账户一个, rclone 文件一份, linux 机器一个 (以 centos7 为例), 然后开始安装 rclone, 安装很简单, 复制粘贴加权限等.
首先是下载文件
yum install unzip wget -y
wget -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
unzip rclone-current-linux-amd64.zip
cd rclone-*-linux-amd64
然后复制文件到相关路径
cp rclone /usr/bin/
chown root:root /usr/bin/rclone
chmod755 /usr/bin/rclone
安装帮助页 (此步骤可以省略, 但省略之后没有一些提示, 不推荐省略)
mkdir -p /usr/local/share/man/man1
cp rclone.1 /usr/local/share/man/man1/
mandb
然后我们新建一个配置
rclone config
下面是直接在官网 copy 的添加 Google Dirve 的过程
    n) New remote
d) Delete remote
q) Quit config
e/n/d/q> n
name> shira(你的配置名称,此处随意填写但之后需要用到)
Typeofstorageto configure.
Choose a numberfrom below, ortypein your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this isnot Google Drive)
\ "google cloud storage"
7 / Google Drive
\ "drive"
8 / Hubic
\ "hubic"
9 / Local Disk
\ "local"
10 / Microsoft OneDrive
\ "onedrive"
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 7(根据网盘类型选择Google Dirve)
Google Application ClientId - leave blank normally.
client_id>此处留空
Google Application Client Secret - leave blank normally.
client_secret>此处留空
Remote config
Useauto config?
* Say Y ifnot sure
* Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n> n(此处一定要选择n)
If your browser doesn'
t open automatically goto the following
link: https://accounts.google.com/o/oauth2/auth?xxxxxxxxxxxxxxxxx
Loginand authorize rclone foraccess
Enter verification code>xxxxxxxxxxx(将上面给出的url复制到你的浏览器打开,登录你的Google Dirve所在的google账户,然后将得到的一串字符串粘贴到此处)
--------------------
[shira]
client_id =
client_secret =
token = {"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null}
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y(确定信息并保存)
网上大多数 "教程"到这里就没有了, 下面是在官网找到的一些操作和同步方法
列出文件和目录
rclone lsd shira: #列出配置名为shira的网盘的目录(不会显示文件)
rclone ls shira:anime #列出配置名为shira的网盘里anime目录下的文件(会显示包括子目录内的所有文件不显示目录)
文件和目录的复制剪切删除操作
rclone copy /root/anime shira:anime #复制本地/root/anime到配置名为shira的网盘的anime目录,反过来也可以
rclone move /root/anime shira:anime #剪切操作
rclone delete shira:anime #删除配置名为shira的网盘的anime目录
rclone mkdir shira:anime #创建配置名为shira的网盘的anime目录
同步文件
rclone sync /root/anime shira:anime#同步本地/root/anime到配置名为shira的网盘的anime目录,反过来也可以 
rclone sync shira2:donga shira:anime #同步本地配置名为shira2的网盘的donga目录到配置名为shira的网盘的anime目录,反过来也可以
其实用到的操作官网几乎都有, 其它需要可以在官网看.
-----

相关帖子:http://briteming.blogspot.com/2017/11/rclonebrowser-rclone.html

Viewing all articles
Browse latest Browse all 20530


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>