A powerful tool for operating Baidu Cloud Disk under Linux
Recently, I have been deploying private SAAS products on the customer side. Since the customer’s on-site network cannot access the Internet, the data can only be transferred through the Linux jump server. In addition to the k8s offline deployment program and image, there are also hundreds of GB of video data that have been cut, so it can only be transferred through Baidu Cloud Disk. Imagine whether it is possible to synchronize Baidu Cloud Disk data through the command line. Google search is really available. Here is a brief introduction to the use of bypy.
bypy introduction
bypy is a Python client for Baidu Cloud/Baidu Cloud Disk, mainly used to operate Baidu Cloud Disk under Linux, providing file list, download, upload, comparison, upward synchronization, downward synchronization and other operations. The main features are: support for Unicode/Chinese; retry on failure; recursive upload/download; directory comparison; hash cache.
In addition, due to the permission restrictions of Baidu PCS API, the program can only access files and directories under the Baidu Cloud/apps/bypy directory.
Install bypy
Install pip
Install bypy
|
|
|
|
Copy and paste the authorization code into the terminal, press Enter, and it’s done.
bypy command detailed explanation
|
|
Summary
This time, the use of bypy has come to an end. In fact, there are many tools based on baidupcs during the research process, but these projects are not maintained later, so I hope bypy can persist.
Reference: https://github.com/houtianze/bypy