ไดเรกทอรีบทความ
กำลังใช้ Rclone เมื่อถ่ายโอนไฟล์ไปยัง OneDrive คุณอาจประสบปัญหาเช่นความเร็วช้าและการขาดการเชื่อมต่อ...
เหตุใด Rclone จึงช้าในการเชื่อมต่อกับ Onedrive
สาเหตุที่แท้จริงคือการทริกเกอร์ข้อจำกัดของ OneDrive API และ Rclone ในตัวที่เป็นค่าเริ่มต้นนั้นถูกใช้โดยผู้ใช้หลายคนพร้อมกัน ดังนั้นปัญหาเหล่านี้จึงชัดเจนขึ้นเรื่อยๆ...
การใช้ API ส่วนตัวที่สร้างขึ้นเองเพื่อเชื่อมต่อกับ OneDrive สามารถปรับปรุงสถานการณ์เหล่านี้ได้อย่างมาก และสำหรับรุ่นทดลองใช้สำหรับนักพัฒนา Office 365 E5 สามเดือน การใช้ Rclone เป็นครั้งคราวจะต่ออายุค่าธรรมเนียมโดยอัตโนมัติ แทนที่จะตั้งใจแปรง API ซึ่งมากกว่า ปลอดภัยและมั่นคง
นอกจากนี้ API ที่สร้างขึ้นเองยังสามารถใช้กับบัญชีอื่นและแอปพลิเคชันอื่นๆ ได้อีกด้วย
หากเป็น API ที่สร้างขึ้นเองของ Google Drive โปรดดูบทแนะนำนี้ ▼
Rclone เชื่อมต่อการทดสอบความเร็ว Onedrive
แบบแรกคือการทดสอบความเร็วของการใช้ API เริ่มต้นของ Rclone เพื่อเชื่อมต่อกับ Onedrive▼
หลังเป็นการทดสอบโดยชาวเน็ตเพื่อใช้ Microsoft API ที่พวกเขาใช้สำหรับเชื่อมต่อกับ Onedrive ▼
- จะเห็นได้อย่างชัดเจนว่าความต่างของความเร็วมากกว่า 10 เท่า
จะสร้าง API ดิสก์เครือข่าย Microsoft Onedrive ได้อย่างไร
วิธีรับรหัสไคลเอ็นต์และข้อมูลลับของไคลเอ็นต์ใน Microsoft Azure Management Center โปรดคลิกลิงก์ด้านล่างเพื่อดูวิธีสร้าง API ดิสก์เครือข่าย Microsoft Onedrive ▼
Rclone ได้รับโทเค็น
ดาวน์โหลด Rclone บนคอมพิวเตอร์ของคุณ ▼
ยกตัวอย่าง Windows ไปที่โฟลเดอร์ที่ rclone.exe ตั้งอยู่หลังจากคลายการบีบอัด ป้อน cmd ในแถบที่อยู่ของ explorer แล้วกด Enter เพื่อเปิดพรอมต์คำสั่งในเส้นทางปัจจุบัน
แทนที่ในคำสั่งต่อไปนี้Client_ID
,Client_secret
และดำเนินการ ▼
rclone authorize "onedrive" "Client_ID" "Client_secret"
- ถัดไปเบราว์เซอร์จะปรากฏขึ้นเพื่อขอให้คุณลงชื่อเข้าใช้บัญชีของคุณเพื่ออนุญาต
หลังจากการอนุญาต ข้อความต่อไปนี้จะปรากฏในหน้าต่างพรอมต์คำสั่ง:
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code Paste the following into your remote machine ---> {"access_token":"xxxxxxxxxxxxxxxxxx","expiry":"2024-05-15T21:18:39.5036298+08:00"} <---End paste
{"access_token":"xxxxxxxxxxxxxxxxxx","expiry":"2024-05-15T21:18:39.5036298+08:00"}
เนื้อหาทั้งหมดนี้ (รวมถึงวงเล็บ) เป็นโทเค็น คัดลอก และบันทึก
Rclone เชื่อมต่อกับ OneDrive
SSH ป้อนคำสั่งต่อไปนี้▼
rclone config
ข้อมูลต่อไปนี้จะปรากฏขึ้น โปรดดูคำแนะนำในการใช้งาน ▼
- ข้อควรระวัง:เนื่องจาก RCLONE จะได้รับการอัปเดตเป็นครั้งคราว เมื่อคุณเห็นบทช่วยสอนนี้ ตัวเลือกเมนูอาจเปลี่ยนแปลงเล็กน้อย แต่แนวคิดทั่วไปจะไม่เปลี่ยนแปลง อย่าคิดที่จะคัดลอกการดำเนินการ
$ rclone config e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> n # 输入 n,新建 name> onedrive # 输入网盘名称,类似标签,这是用来区别不同的网盘。 Type of storage to configure. Enter a string value. Press Enter for the default (""). 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, Digital Ocean, Dreamhost, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS \ (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 / Compress a remote \ (compress) 12 / Dropbox \ (dropbox) 13 / Encrypt/Decrypt a remote \ (crypt) 14 / Enterprise File Fabric \ (filefabric) 15 / FTP Connection \ (ftp) 16 / Google Cloud Storage (this is not Google Drive) \ (google cloud storage) 17 / Google Drive \ (drive) 18 / Google Photos \ (google photos) 19 / Hadoop distributed file system \ (hdfs) 20 / Hubic \ (hubic) 21 / In memory object storage system. \ (memory) 22 / Jottacloud \ (jottacloud) 23 / Koofr, Digi Storage and other Koofr-compatible storage providers \ (koofr) 24 / Local Disk \ (local) 25 / Mail.ru Cloud \ (mailru) 26 / Mega \ (mega) 27 / Microsoft Azure Blob Storage \ (azureblob) 28 / Microsoft OneDrive \ (onedrive) 29 / OpenDrive \ (opendrive) 30 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH) \ (swift) 31 / Pcloud \ (pcloud) 32 / Put.io \ (putio) 33 / QingCloud Object Storage \ (qingstor) 34 / SSH/SFTP Connection \ (sftp) 35 / Sia Decentralized Cloud \ (sia) 36 / Storj Decentralized Cloud Storage \ (storj) 37 / Sugarsync \ (sugarsync) 38 / Transparently chunk/split large files \ (chunker) 39 / Union merges the contents of several upstream fs \ (union) 40 / Uptobox \ (uptobox) 41 / Webdav \ (webdav) 42 / Yandex Disk \ (yandex) 43 / Zoho \ (zoho) 44 / http Connection \ (http) 45 / premiumize.me \ (premiumizeme) 46 / seafile \ (seafile) Storage> 28 # 输入28表示选择Microsoft OneDrive Option client_id. OAuth Client Id. Leave blank normally. Enter a value. Press Enter to leave empty. client_id> # 输入 Client Id (客户端 ID) Microsoft App Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> # 输入 Client Secret (客户端密码) Edit advanced config? (y/n) y) Yes n) No y/n> n # 输入 n Remote config Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config. Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes n) No y/n> n # 输入 n For this to work, you will need rclone available on a machine that has a web browser available. Execute the following on your machine (same rclone version recommended) : rclone authorize "onedrive" "client_id" "client_secret" Then paste the result below: result> {"access_token":"XXXXXXXXX","expiry":"2024-05-15T21:18:39.5036298+08:00"} # 输入 token 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 # # 这里询问你要选择的类型,因为你使用的是OneDrive,所以输入1 Found 1 drives, please select the one you want to use: 0: OneDrive (business) id=xxxxxxxxxxxxxx Chose drive to use:> 0 # 检测到网盘,此处号码是0,所以输入0 Found drive 'root' of type 'business', URL: https:// xxx.sharepoint. com/personal/xxxxxx/Documents Is that okay? y) Yes n) No y/n> y # 请你确认,如果没有问题,请输入 y -------------------- [od-e5-api] type = onedrive client_id = xxxxxxxxxx client_secret = xxxxxxxxxxxxxxxx token = {"access_token":"xxxxxxxxxxxxxxxxxx","expiry":"2024-05-15T21:18:39.5036298+08:00"} drive_id = xxxxxxxxxxxxxxxxxxxxxxxxx drive_type = business -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y # 最后会显示网盘的配置信息,请确认是否准确无误? 如果没有问题,请输入 y Current remotes: Name Type ==== ==== onedrive onedrive e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> q # 输入 q 退出
- จนถึงตอนนี้ Rclone ได้เชื่อมต่อกับดิสก์เครือข่าย OneDrive เรียบร้อยแล้วโดยใช้ API ที่สร้างขึ้นเอง
เมื่อกำหนดค่าแล้ว คุณสามารถใช้สิ่งต่อไปนี้rclone
คำสั่งดู:
แสดงรายการไดเร็กทอรีที่ระดับบนสุดของ onedrive▼
rclone lsd onedrive:
แสดงรายการไฟล์ทั้งหมดใน onedrive▼
rclone ls onedrive:
คัดลอกโลคัลไดเร็กทอรีไปยังไดเร็กทอรีชื่อbackup
ไดเร็กทอรี onedrive▼
rclone copy /home/source onedrive:backup
คัดลอก ตัด ลบ คำสั่ง
คัดลอกไฟล์การกำหนดค่า Rclone ไปยังไดเร็กทอรีรากของดิสก์เครือข่าย onedrive ▼
rclone copy /root/.config/rclone/rclone.conf onedrive:/
คัดลอกท้องถิ่น /home/backup
ไปที่ไดเร็กทอรีสำรองที่มีการกำหนดค่าดิสก์เครือข่ายชื่อ onedrive และในทางกลับกัน ▼
rclone copy --progress /home/backup onedrive:backup
- โดยการเพิ่มพารามิเตอร์นี้
--ignore-existing
ไฟล์ที่สำรองไว้บนดิสก์เครือข่ายสามารถละเว้นได้ ซึ่งเทียบเท่ากับการสำรองข้อมูลส่วนเพิ่ม ▼
rclone copy --ignore-existing /home/backup onedrive:backup
คัดลอกไฟล์สำรองข้อมูล CWP ด้วยตนเองในเครื่องไปยังไดเร็กทอรีสำรองของดิสก์เครือข่ายชื่อ onedrive และในทางกลับกัน ▼
rclone copy --progress /newbackup/full/manual/accounts/eloha.tar.gz onedrive:cwp-newbackup/full/manual/accounts/
จากดิสก์เครือข่าย onedrive ให้คัดลอกไฟล์สำรองข้อมูลตามกำหนดเวลาอัตโนมัติของ CWP ไปยังโลคัล /newbackup
แคตตาล็อก▼
rclone copy --progress onedrive:cwp-newbackup/full/daily/Friday/accounts/eloha.tar.gz /newbackup/ rclone copy --progress onedrive:cwp-backup2/ /home/backup2/
จากดิสก์เครือข่าย onedrive ให้คัดลอกไฟล์สำรองข้อมูล CWP ด้วยตนเองไปยัง local /newbackup/newbackup/full/manual/accounts/
แคตตาล็อก▼
rclone copy --progress onedrive:cwp-newbackup/full/manual/accounts/eloha.tar.gz /newbackup/newbackup/full/manual/accounts/
คัดลอกจากดิสก์เครือข่ายของ onedriveVestaCPสำรองไฟล์ไว้ในเครื่อง /home/backup
แคตตาล็อก▼
rclone copy --progress onedrive:backup/admin.2018-04-12_13-10-02.tar /home/backup
คำสั่งย้าย (ตัด) ▼
rclone move /home/backup onedrive:backup
ลบไดเร็กทอรีสำรองของดิสก์เครือข่ายด้วยชื่อการกำหนดค่า onedrive▼
rclone delete onedrive:backup
สร้างไดเร็กทอรีสำรองที่กำหนดค่าดิสก์เครือข่ายชื่อ onedrive ▼
rclone mkdir onedrive:backup
คัดลอก ▼
rclone copy
ย้าย ▼
rclone move
ลบ ▼
rclone delete
ซิงค์ ▼
rclone sync
สำหรับบทแนะนำการใช้คำสั่ง Rclone เพิ่มเติม โปรดดูที่ชุดคำสั่ง Rclone ด้านล่าง▼
จะเมานต์ OneDrive ได้อย่างไร?
หากคุณต้องการเมาต์กับไดเร็กทอรีในเครื่อง คุณสามารถดูบทช่วยสอนการติดตั้ง Rclone ก่อนหน้าของเรา▼
ข้อจำกัดของ OneDrive Private API
แม้ว่า API ส่วนตัวที่สร้างขึ้นเองสามารถปรับปรุงประสบการณ์การอัปโหลดได้ แต่การอัปโหลดอาจถูกจำกัดหากใช้บ่อยเกินไป
ขีดจำกัดสูงสุดสำหรับ Microsoft OneDrive API คืออะไร
Microsoft ไม่ได้ระบุอย่างชัดเจนว่าขีดจำกัดสูงสุดของ OneDrive API คืออะไร ต่อไปนี้เป็นเอกสารต้นฉบับ:
ตามการใช้งาน เราปรับแต่งเกณฑ์เพื่อให้ผู้ใช้สามารถใช้ทรัพยากรจำนวนสูงสุดได้โดยไม่กระทบต่อความน่าเชื่อถือและประสิทธิภาพ
- อย่างที่คุณเดาได้จากการดูคำอธิบายของขีดจำกัด API ประเภทอื่นๆ มีขีดจำกัดสองแบบคือ ทั้งหมด และ ความถี่
- ยอดรวมคือจำนวนการโทรที่สามารถทำได้ในหนึ่งวัน และความถี่คือจำนวนการโทรที่สามารถทำได้ต่อนาที
- และเมื่อถึงเกณฑ์การควบคุม การอัปโหลดไฟล์จะถูกควบคุมปริมาณ
- เนื่องจากไม่สามารถหาค่าที่แน่นอนได้จากเอกสารอย่างเป็นทางการ เป็นไปได้ไหมที่จะได้ค่าที่แน่นอนนี้จากการทดสอบจริง?
- คำตอบคือเชิงลบไม่พบกฎเกณฑ์ในการทดสอบจริง ดังนั้นขีดจำกัดนี้จึงถูกปรับแบบไดนามิกและสอดคล้องกับเอกสารอย่างเป็นทางการ
ฉันจะหลีกเลี่ยงการถูกจำกัดโดย OneDrive API ได้อย่างไร
อย่าอัพโหลดไฟล์มากเกินไปในช่วงเวลาสั้น ๆ ขนาดไฟล์ไม่สำคัญ กุญแจสำคัญคือจำนวนไฟล์
เกี่ยวกับการต่ออายุอัตโนมัติของ Office 365 E5:
- จากประสบการณ์ของผู้ใช้ที่ใช้เวอร์ชันทดลองของนักพัฒนาซอฟต์แวร์เป็นเวลาหลายปี ตราบใดที่คุณใช้ API ส่วนตัวที่สร้างขึ้นเอง คุณก็สามารถต่ออายุการสมัครรับข้อมูลได้
- ส่วนความถี่นั้นไม่มีมาตรฐานและยิ่งดี
- การแปรง API อย่างจงใจอาจไม่คุ้มกับการสูญเสีย โดยเฉพาะอย่างยิ่งการใช้ GitHub Actions เนื่องจากเซิร์ฟเวอร์คือ Microsoft Azure ผู้คนจำนวนมากจึงใช้วิธีการที่คล้ายกันในการแปรง API ที่ไม่มีความหมาย และ Microsoft Azure ต้องการระบุได้ง่าย
หวัง Chen Weiliang บล็อก ( https://www.chenweiliang.com/ ) แชร์ "Rclone ช้าในการเชื่อมต่อกับ Onedrive?ถ่ายโอนข้อมูลขีด จำกัด ความเร็วหรือไม่ กำหนดค่าการเร่งความเร็ว API" เพื่อช่วยคุณ
ยินดีต้อนรับสู่การแบ่งปันลิงค์ของบทความนี้:https://www.chenweiliang.com/cwl-27906.html
ยินดีต้อนรับสู่ช่อง Telegram ของบล็อกของ Chen Weiliang เพื่อรับข่าวสารล่าสุด!
📚 คู่มือนี้มีคุณค่ามหาศาล 🌟 นี่เป็นโอกาสที่หายาก อย่าพลาด! ⏰⌛💨
แชร์และชอบถ้าคุณชอบ!
การแบ่งปันและไลค์ของคุณเป็นแรงจูงใจอย่างต่อเนื่องของเรา!