Linux版百度网盘丨直接在服务器SSH命令行中使用百度云,轻松解决数据传输和分享难题

Linux版 百度网盘

本文主要的目的就是在Linux环境下通过命令行来使用百度云盘!直接在服务器上将数据(比如基因组等大文件)传输到百度网盘,之后可以进行轻松分享,而且还可以支持备份,解决文件的传输和分享难题。

软件简介

bypy是一个Python客户端,用于操作百度网盘,提供了丰富的命令行操作。该工具能够直接在Linux服务器上进行大文件的传输,支持多线程操作,本文将介绍如何使用bypy进行百度云的上传、下载、同步等操作。

安装

pip install bypy

命令

bypy提供了多种操作命令,具体如下:

  • quota:显示百度云存储配额信息
  • list:列出指定目录下的文件列表
  • upload:上传本地文件到百度云
  • download:从百度云下载文件到本地
  • syncup:将本地文件同步到百度云
  • syncdown:将百度云文件同步到本地
  • delete:删除百度云上的文件
  • makedir:在百度云上创建目录
  • move:移动百度云上的文件
  • copy:复制百度云上的文件
  • compare:比较本地和云文件的差异

调试

  • 运行时添加-v参数,会显示进度详情
  • 运行时添加-d,会显示一些调试信息
  • 运行时添加-ddd,显示HTTP通讯信息

使用示例

登录配置

(test) [user @ cloud  20:17:08 /mnt/data/]
$ bypy info
Please visit:
https://openapi.baidu.com/oauth/2.0/authorize?client_id=q8W
And authorize this app
Paste the Authorization Code here within 10 minutes.
Press [Enter] when you are done
c5c3085d143f880df0727d3f
Authorizing, please be patient, it may take upto 300 seconds...
Quota: 10.010TB
Used: 1.332TB

登录验证后会显示当前剩余储存空间和已用空间,比如我这里大概10TB左右。

主要参数

$ bypy -h
usage: bypy [-h] [-V] [-d] [-v] [-r RETRY] [-q] [-t TIMEOUT] [-s SLICE] [--chunk CHUNK] [-e] [-f]
            [--no-resume-download] [--include-regex INCREGEX] [--on-dup ONDUP] [--no-symlink]
            [--disable-ssl-check] [--cacerts CACERTS] [--mirror MIRROR] [--select-fastest-mirror]
            [--rapid-upload-only] [--resume-download-revert-back RCOUNT] [--move] [--processes PROCESSES]
            [--downloader DOWNLOADER] [--downloader-arguments DOWNLOADER_ARGS] [--config-dir CONFIGDIR] [-c]
            [command ...]

命令行参数解释

bypy提供了丰富的命令行参数,具体如下:

- `-h`,`--help`:显示帮助信息
- `-V`,`--version`:显示版本信息
- `-d`,`--debug`:设置调试级别
- `-v`,`--verbose`:设置详细程度
- `-r`,`--retry`:网络错误时重试的次数
- `-q`,`--quit-when-fail`:最大重试次数失败时退出
- `-t`,`--timeout`:网络超时时间(秒)
- `-s`,`--slice`:文件上传切片大小
- `--chunk`:文件下载块大小
- `-e`,`--verify`:验证上传/下载
- `-f`,`--force-hash`:强制文件MD5/CRC32计算而不使用缓存值
- `--no-resume-download`:如果本地文件已经存在,则恢复而不是重新开始下载 
- `--include-regex`:要包括的文件的正则表达式。
- `--on-dup`:在目标中存在相同的文件/文件夹时要执行的操作
- `--no-symlink`:上传/同步时不要跟随符号链接
- `--disable-ssl-check`:不要验证主机SSL证书
- `--cacerts`:指定CA Bundle的路径
- `--mirror`:指定PCS镜像
- `--select-fastest-mirror`:让程序运行一些测试并选择它检测到的最快的PCS镜像。
- `--rapid-upload-only`:仅上传可以快速上传的大文件
- `--resume-download-revert-back`:恢复下载时至少回退RCOUNT下载块并对齐到块边界。负值表示不回退。 
- `--move`:在下载/上传/syncdown/syncup成功后删除源文件/目录(这将强制验证文件)。
- `--processes`:并行进程数。 (仅适用于目录同步/下载/上传)。
- `--downloader`:要使用的下载程序(如果未指定,则使用Python)。
- `--downloader-arguments`:下载程序的参数
- `--config-dir`:指定配置路径
- `-c`,`--clean`:删除令牌文件(需要重新认证)和上传进度文件

上传文件

bypy upload /path/to/local/file /remote/path

下载文件

bypy download /remote/path /path/to/local/file

同步文件

bypy syncup /local/path /remote/path
bypy syncdown /remote/path /local/path

bypy是一个非常强大的Python客户端,可以方便地操作百度云。我觉得这个工具还是挺好用的,比如用百度云盘和其他人直接从linux服务器上传文件,解决文件传输问题。

参考资料:

https://blog.csdn.net/weixin_42232041/article/details/106816582
https://github.com/houtianze/bypy

本文由mdnice多平台发布

  • 4
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
T • Enabling more consistent, comparable, and repeatable assessments of security controls in federal information systems; • Promoting a better understanding of agency-related mission risks resulting from the operation of information systems; and • Creating more complete, reliable, and trustworthy information for authorizing officials—to facilitate more informed security accreditation decisions. Security certification and accreditation are important activities that support a risk management process and are an integral part of an agency’s information security program. Security accreditation is the official management decision given by a senior agency official to authorize operation of an information system and to explicitly accept the risk to agency operations, agency assets, or individuals based on the implementation of an agreed-upon set of security controls. Required by OMB Circular A-130, Appendix III, security accreditation provides a form of quality control and challenges managers and technical staffs at all levels to implement the most effective security controls possible in an information system, given mission requirements, technical constraints, operational constraints, and cost/schedule constraints. By accrediting an information system, an agency official accepts responsibility for the security of the system and is fully accountable for any adverse impacts to the agency if a breach of security occurs. Thus, responsibility and accountability are core principles that characterize security accreditation. It is essential that agency officials have the most complete, accurate, and trustworthy information possible on the security status of their information systems in order to make timely, credible, risk-based decisions on whether to authorize operation of those systems. The information and supporting evidence needed for security accreditation is developed during a detailed security review of an information system, typically referred to as security certification. Security certification is a comprehensive assessment of the management, operational, and technical security controls in an information system, made in support of security accreditation, to determine the extent to which the controls are implemented correctly, operating as intended, and producing the desired outcome with respect to meeting the security requirements for the system. The results of a security certification are used to reassess the risks and update the system security plan, thus providing the factual basis for an authorizing official to render a security accreditation decision.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

生信分析笔记

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值