OneDrive里的文件备份到其他网盘

想着把自己发的资源存到另一个OD盘中做备份,避免文件没了(因为现在也没上传权限了)。文中例子为转移到另一个od盘,应该也支持其他数十种网盘,例如Google Drive,Mega,但不支持百度云。
本来是想用mover.io,但报错(Unable to get contents of this (404) Not Found: ResourceNotFound: Invalid version: _api)
使用软件为:rclone

安装
可以选择自己电脑 / 其他设备 / 服务器上
p.s. 需注意流量的费用
– 命令行下载
    curl https://rclone.org/install.sh | sudo bash
– 失败请在官网自己下载对应版本
为下载一个压缩包,解压后请`cd`进那个文件夹

获取`OneDrive`授权码
## 以下步骤需重复两次(如果有几个od就重复几次)
打开命令行,输入:
    rclone authorize “onedrive”
请在打开的浏览器内登录你的`OneDrive`,登录完就可以关闭页面回到命令行界面。
请保存命令行刚刚显示的授权码,例如:
    {“access_token”:”aaabbbcccddd”,”token_type”:”Bearer”,”refresh_token”:”aaabbbcccddd”,”expiry”:”2022-08-27xxxxx”}

使软件连接到`OneDrive`上
## 以下步骤需重复两次(如果有几个od就重复几次)
在命令行输入:
    rclone config
会显示以下信息,输入`n`+回车:
    n) New remote
    s) Set configuration password
    q) Quit config
    n/s/q> n
然后为这个连接取个名,后面需要用到,这里举例使用`example001`:
    Enter name for new remote.
    name> example001
接着在列举的选项中找到`OneDrive`,例如我的在`32`,就输入该数字:
p.s. 我删了一些支持的网盘,避免文章太长
    Option Storage.
    Type of storage to configure.
    Choose a number from below, or type in your own value.
    1 / 1Fichier
    \ (fichier)
    2 / Akamai NetStorage
    \ (netstorage)
    3 / Alias for an existing remote
    \ (alias)
    4 / Amazon Drive
    \ (amazon cloud drive)
    5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, Digital Ocean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi
    \ (s3)
    6 / Backblaze B2
    \ (b2)
    7 / Better checksums for other remotes
    \ (hasher)
    8 / Box
    \ (box)
    9 / Cache a remote
    \ (cache)
    10 / Citrix Sharefile
    \ (sharefile)
    11 / Combine several remotes into one
    \ (combine)
    12 / Compress a remote
    \ (compress)
    13 / Dropbox
    \ (dropbox)
    14 / Encrypt/Decrypt a remote
    \ (crypt)
    15 / Enterprise File Fabric
    \ (filefabric)
    16 / FTP
    \ (ftp)
    17 / Google Cloud Storage (this is not Google Drive)
    \ (google cloud storage)
    18 / Google Drive
    \ (drive)
    19 / Google Photos
    \ (google photos)
    20 / HTTP
    \ (http)
    21 / Hadoop distributed file system
    \ (hdfs)
    22 / HiDrive
    \ (hidrive)
    23 / Hubic
    \ (hubic)
    24 / In memory object storage system.
    \ (memory)
    25 / Internet Archive
    \ (internetarchive)
    26 / Jottacloud
    \ (jottacloud)
    27 / Koofr, Digi Storage and other Koofr-compatible storage providers
    \ (koofr)
    28 / Local Disk
    \ (local)
    29 / Mail.ru Cloud
    \ (mailru)
    30 / Mega
    \ (mega)
    31 / Microsoft Azure Blob Storage
    \ (azureblob)
    32 / Microsoft OneDrive
    \ (onedrive)
    33 / OpenDrive
    \ (opendrive)
    34 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
    \ (swift)
    Storage> 32

接下来许多信息都可以摁回车跳过(留空):
    Option client_id.
    OAuth Client Id.
    Leave blank normally.
    Enter a value. Press Enter to leave empty.
    client_id>

 

    Option client_secret.
    OAuth Client Secret.
    Leave blank normally.
    Enter a value. Press Enter to leave empty.
    client_secret>

 

    Option region.
    Choose national cloud region for OneDrive.
    Choose a number from below, or type in your own string value.
    Press Enter for the default (global).
    1 / Microsoft Cloud Global
    \ (global)
    2 / Microsoft Cloud for US Government
    \ (us)
    3 / Microsoft Cloud Germany
    \ (de)
    4 / Azure and Office 365 operated by 21Vianet in China
    \ (cn)
    region>

在`advanced config`和`auto config`选`n`:
    Edit advanced config?
    y) Yes
    n) No (default)
    y/n> n

 

    Use auto config?
    * Say Y if not sure
    * Say N if you are working on a remote or headless machine

 

    y) Yes (default)
    n) No
    y/n> n

接下来输入刚刚得到的授权码:
    Option config_token.
    For this to work, you will need rclone available on a machine that has
    a web browser available.
    For more help and alternate methods see: https://rclone.org/remote_setup/
    Execute the following on the machine with the web browser (same rclone
    version recommended):
        rclone authorize “onedrive”
    Then paste the result.
    Enter a value.
    config_token>{“access_token”:”aaabbbcccddd”,”token_type”:”Bearer”,”refresh_token”:”aaabbbcccddd”,”expiry”:”2022-08-27xxxxx”}

然后选择`OneDrive`(`1`):
    Choose a number from below, or type in an existing value
    1 / OneDrive Personal or Business
    \ “onedrive”
    2 / Root Sharepoint site
    \ “sharepoint”
    3 / Type in driveID
    \ “driveid”
    4 / Type in SiteID
    \ “siteid”
    5 / Search a Sharepoint site
    \ “search”
    Your choice> 1

 

接着就选择自己网盘(例如我的为`1`):
    Found 1 drives, please select the one you want to use:
    1: OneDrive (business) id=xxxxxx
    Chose drive to use:> 1

 

再填`y`确认
    Found drive ‘root’ of type ‘business’, URL: https://xxxxx
    Is that okay?
    y) Yes
    n) No
    y/n> y

 

最后再确认一边之前的信息,输入`y`确认:
    [one]
    type = onedrive
    token = {“access_token”:”aaabbbcccddd”,”token_type”:”Bearer”,”refresh_token”:”aaabbbcccddd”,”expiry”:”2022-08-27xxxxx”}
    drive_id = xxxxxx
    drive_type = business

 

    y) Yes this is OK
    e) Edit this remote
    d) Delete this remote
    y/e/d> y

 

完成后可以输入`n`继续添加另一个OD盘,或输入`q`退出。

开始拷贝
用法:
    rclone copy source:path dest:path [flags]
flags请使用`rclone copy –help`查看具体说明,这里仅使用了基础功能
例如我刚刚添加了两个`OneDrive`盘:
– `example001`
– `example002`
我想把`example001`里的所有文件都复制到`example002`里的`backup`文件夹中,那么使用:
    rclone copy example001: example002:/backup
同理,如果想复制`example001`里的`sample`文件夹到`example002`里的`backup`文件夹中,那么使用:
    rclone copy example001:/sample example002:/backup
如果摁回车后没反应的话应该是正常的,可以打开目标盘检查,应该可以看见复制已经开始了。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得UP主同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理:DMCA投诉/Report
学习区-技术教程

VMOS_Pro v2.5.0 VIP破解版软件分享

2022-8-25 19:30:45

学习区-技术教程

自用5TOnedrive申请、使用、防炸攻略

2022-8-31 20:05:28

8 条回复 A文章作者 M管理员
  1. 神的righthand

    可以的,收藏了,希望有用的上的一天

  2. 可爱的阿卡林

    大佬赞,没上传权限是因为上次那个有人滥用导致维咔od出问题的事吗,总有些害群之马啊。

  3. 剑难留

    收藏了,说不定能用上

  4. tolkien

    感謝分享

  5. ink

    嘛,还是好用的。
    我发现如果我们用的是同一个域可以直接复制到我的od里
    (这样是不是之后大家换了新的一样的域之后作者内部传文件会好用点)

  6. Reisen

    还是提一嘴,curl一般是在Linux/MacOS上用的,Windows要整curl和.sh不是不行,就是比较逆天比较麻烦也没必要,还是老老实实官网下载压缩包吧

  7. i6zfqwiz8

    补充一下 在复制命令的结尾

    rclone copy example001:/sample example002:/backup
    

    加上 -P 参数就可以查看复制进度了。

  8. 天野喜欢黄油

    圈外人完全不懂,头好痛,要长脑子了

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索