首页
关于
Search
1
X-ui可视化面板安装及使用教程
1,925 阅读
2
azure100刀换IP教程
1,333 阅读
3
Emby/Jellyfin 的一个日本电影刮削器插件
1,090 阅读
4
使用Python批量发送视频、图片到TG频道
1,052 阅读
5
docker下部署青龙面板京东自动签到
1,008 阅读
随记
Python
流水
登录
/
注册
Search
标签搜索
宝塔
脚本
Wordpress
docker
centos7
腾讯云
宝塔面板
Python
甲骨文
Rclone
WIN7
Python3
virmach
破解
BBr
反向代理
Onemanager
onedrive
Euserv
火车头
Phon
累计撰写
142
篇文章
累计收到
3
条评论
首页
栏目
随记
Python
流水
页面
关于
搜索到
3
篇与
的结果
2022-02-20
rclone挂载谷歌团队盘操作记录
1、安装rclonecurl https://rclone.org/install.sh | sudo bash2、初始化配置rclone config 3、每一步的设置[root@centos72 ~]# rclone config 2022/02/20 20:09:43 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n #选n(new)新建 name> googlepan #给挂载的盘取一个名称 Option Storage. 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 / Alias for an existing remote \ "alias" 3 / Amazon Drive \ "amazon cloud drive" 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COt COS \ "s3" 5 / Backblaze B2 \ "b2" 6 / Better checksums for other remotes \ "hasher" 7 / Box \ "box" 8 / Cache a remote \ "cache" 9 / Citrix Sharefile \ "sharefile" 10 / Compress a remote \ "compress" 11 / Dropbox \ "dropbox" 12 / Encrypt/Decrypt a remote \ "crypt" 13 / Enterprise File Fabric \ "filefabric" 14 / FTP Connection \ "ftp" 15 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage" 16 / Google Drive \ "drive" 17 / Google Photos \ "google photos" 18 / Hadoop distributed file system \ "hdfs" 19 / Hubic \ "hubic" 20 / In memory object storage system. \ "memory" 21 / Jottacloud \ "jottacloud" 22 / Koofr \ "koofr" 23 / Local Disk \ "local" 24 / Mail.ru Cloud \ "mailru" 25 / Mega \ "mega" 26 / Microsoft Azure Blob Storage \ "azureblob" 27 / Microsoft OneDrive \ "onedrive" 28 / OpenDrive \ "opendrive" 29 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH) \ "swift" 30 / Pcloud \ "pcloud" 31 / Put.io \ "putio" 32 / QingCloud Object Storage \ "qingstor" 33 / SSH/SFTP Connection \ "sftp" 34 / Sia Decentralized Cloud \ "sia" 35 / Sugarsync \ "sugarsync" 36 / Tardigrade Decentralized Cloud Storage \ "tardigrade" 37 / Transparently chunk/split large files \ "chunker" 38 / Union merges the contents of several upstream fs \ "union" 39 / Uptobox \ "uptobox" 40 / Webdav \ "webdav" 41 / Yandex Disk \ "yandex" 42 / Zoho \ "zoho" 43 / http Connection \ "http" 44 / premiumize.me \ "premiumizeme" 45 / seafile \ "seafile" Storage> 16 #选择16为挂载谷歌盘 Option client_id. Google Application Client Id Setting your own is recommended. See https://rclone.org/drive/#making-your-own-client-id for how to create your own. If you leave this blank, it will use an internal key which is low performance. Enter a string value. Press Enter for the default (""). client_id> #回车 Option client_secret. OAuth Client Secret. Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> #回车 Option scope. Scope that rclone should use when requesting access from drive. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value. 1 / Full access all files, excluding Application Data Folder. \ "drive" 2 / Read-only access to file metadata and file contents. \ "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app. \ "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website. \ "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content. \ "drive.metadata.readonly" scope> 1 #选1授权最大化 Option root_folder_id. ID of the root folder. Leave blank normally. Fill in to access "Computers" folders (see docs), or for rclone to use a non root folder as its starting point. Enter a string value. Press Enter for the default (""). root_folder_id> #回车 Option service_account_file. Service Account Credentials JSON file path. Leave blank normally. Needed only if you want use SA instead of interactive login. Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. Enter a string value. Press Enter for the default (""). service_account_file> #回车 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_verification_code. Verification code Go to this URL, authenticate then paste the code here. https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=23hmtSsBo1PMLbH2c2iIKg Enter a string value. Press Enter for the default (""). config_verification_code> 4/1AX4XfW #把上面的网址复制到浏览器中并确认授权,得到一串授权码粘贴在这里 Configure this as a Shared Drive (Team Drive)? y) Yes n) No (default) y/n> y #确定挂载团队盘 -------------------- [googlepan] type = drive scope = drive token = {"access_token":"ya29.A0ARrda","token_type":"Bearer","refresh_token":"1//0e","expiry":"2022-02-20T21:13:44.7664075+08:00"} team_drive = 0AH4I8T23 root_folder_id = -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y #确认配置 Current remotes: Name Type ==== ==== googlepan drive 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退出 二、挂载Google Drive1.创建一个googlepan目录,作为挂载目录mkdir -p /googlepan2、挂载参数 –后面跟的是参数 可以自己调整,mount后面跟的是googlepan,也就是最开始命名的那个名字。后面的/googlepan是刚刚新建的目录。/usr/bin/rclone mount googlepan: /googlepan \ --umask 0000 \ --default-permissions \ --allow-non-empty \ --allow-other \ --buffer-size 32M \ --dir-cache-time 12h \ --vfs-read-chunk-size 64M \ --vfs-read-chunk-size-limit 1G &回车,如果出现以下错误:Fatal error: failed to mount FUSE fs: fusermount: exec: "fusermount": executable file not found in $PATH请安装fuse:yum -y install fuse3、挂载成功后,输入命令查看:df -hFilesystem Size Used Avail Use% Mounted ondevtmpfs 459M 0 459M 0% /devtmpfs 493M 4.0K 493M 1% /dev/shmtmpfs 493M 50M 443M 11% /runtmpfs 493M 0 493M 0% /sys/fs/cgroup/dev/sda3 39G 4.5G 34G 12% //dev/sda1 512M 12M 501M 3% /boot/efitmpfs 99M 0 99M 0% /run/user/994tmpfs 99M 0 99M 0% /run/user/1000googlepan: 1.0P 0 1.0P 0% /googlepan此时进宝塔面板刷新应该就可以看到挂载的谷歌1.0P空间的盘了三、守护运行宝塔安装Supervisor管理器,守护挂载好的GoogleDrive。如果有挂载多个网盘,需要添加多个进程守护。名称:随便填启动用户:root运行目录:/启动命令:就是上面的挂载命令/usr/bin/rclone mount googlepan: /googlepan --umask 0000 --default-permissions --allow-non-empty --allow-other --buffer-size 32M --dir-cache-time 12h --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit 1G 进程数量:1四、如果要卸载,可以使用以下命令来完成。rclone config根据提示操作,此处不再赘述。记得卸载了,也要把Supervisor守护进程删除。五、如果不用宝塔的也可以这样1、新建systemd配置文件,以下是一整条命令,一起复制到SSH客户端运行。如果你想挂载多个网盘,那么将systemd配置文件的rclone.service改成rclone1.service即可,重启动什么的同样换成rclone1。把googlepan改成你的挂载盘的名字(前)和/目录(后)cat > /etc/systemd/system/rclone.service <<EOF [Unit] Description=Rclone AssertPathIsDirectory=LocalFolder After=network-online.target [Service] Type=simple ExecStart=/usr/bin/rclone mount googlepan: /googlepan \ --umask 0000 \ --default-permissions \ --allow-non-empty \ --allow-other \ --buffer-size 32M \ --dir-cache-time 12h \ --vfs-read-chunk-size 64M \ --vfs-read-chunk-size-limit 1G ExecStop=/bin/fusermount -u LocalFolder Restart=on-abort User=root [Install] WantedBy=default.target EOF启动systemctl start rclone开机启动systemctl enable rclone重新启动systemctl restart rclone停止systemctl stop rclone五、rclone命令用法### 文件上传 rclone copy /home/backup gdrive:backup # 本地路径 配置名字:谷歌文件夹名字 ### 文件下载 rclone copy gdrive:backup /home/backup ### 列表 rclone ls gdrive:backup rclone lsl gdrive:backup # 比上面多一个显示上传时间 rclone lsd gdrive:backup # 只显示文件夹 ### 新建文件夹 rclone mkdir gdrive:backup ### 挂载 rclone mount gdrive:mm /root/mm & ### 卸载 fusermount -u /root/mm #### 其他 #### #### https://softlns.github.io/2016/11/28/rclone-guide/ rclone config - 以控制会话的形式添加rclone的配置,配置保存在.rclone.conf文件中。 rclone copy - 将文件从源复制到目的地址,跳过已复制完成的。 rclone sync - 将源数据同步到目的地址,只更新目的地址的数据。 –dry-run标志来检查要复制、删除的数据 rclone move - 将源数据移动到目的地址。 rclone delete - 删除指定路径下的文件内容。 rclone purge - 清空指定路径下所有文件数据。 rclone mkdir - 创建一个新目录。 rclone rmdir - 删除空目录。 rclone check - 检查源和目的地址数据是否匹配。 rclone ls - 列出指定路径下所有的文件以及文件大小和路径。 rclone lsd - 列出指定路径下所有的目录/容器/桶。 rclone lsl - 列出指定路径下所有文件以及修改时间、文件大小和路径。 rclone md5sum - 为指定路径下的所有文件产生一个md5sum文件。 rclone sha1sum - 为指定路径下的所有文件产生一个sha1sum文件。 rclone size - 获取指定路径下,文件内容的总大小。. rclone version - 查看当前版本。 rclone cleanup - 清空remote。 rclone dedupe - 交互式查找重复文件,进行删除/重命名操作。 #### 其他 #### 挂载到本地 apt-get install -y nload htop fuse p7zip-full #::挂载为磁盘 rclone mount DriveName:Folder LocalFolder --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 #::卸载磁盘 fusermount -qzu LocalFolder
2022年02月20日
734 阅读
0 评论
0 点赞
2021-04-11
rclone开机启动
1.先新建systemd配置文件,适用CentOS 7、Debian 8+、Ubuntu 16+2.再使用命令:#将后面修改成你上面手动运行命令中,除了rclone的全部参数 command="mount onedrive5: /home/onedrive --allow-other --allow-non-empty --vfs-cache-mode writes" #以下是一整条命令,一起复制到SSH客户端运行 cat > /etc/systemd/system/rclone.service <<EOF [Unit] Description=Rclone After=network-online.target [Service] Type=simple ExecStart=$(command -v rclone) ${command} Restart=on-abort User=root [Install] WantedBy=default.target EOF3.开始启动:systemctl enable rclone4.其他命令:重启:systemctl restart rclone 停止:systemctl stop rclone 状态:systemctl status rclone如果你想挂载多个网盘,那么将systemd配置文件的rclone.service改成rclone1.service即可,重启动什么的同样换成rclone1。
2021年04月11日
159 阅读
0 评论
0 点赞
2021-04-11
Rclone 常用命令参数
1.命令语法# 本地到网盘 rclone [功能选项] <本地路径> <网盘名称:路径> [参数] [参数] ... # 网盘到本地 rclone [功能选项] <网盘名称:路径> <本地路径> [参数] [参数] ... # 网盘到网盘 rclone [功能选项] <网盘名称:路径> <网盘名称:路径> [参数] [参数] ...2.用法示例rclone move -v /Download Onedrive:/Download --transfers=13.常用功能选项rclone copy - 复制 rclone move - 移动,如果要在移动后删除空源目录,请加上 --delete-empty-src-dirs 参数 rclone sync - 同步:将源目录同步到目标目录,只更改目标目录。 rclone size - 查看网盘文件占用大小。 rclone delete - 删除路径下的文件内容。 rclone purge - 删除路径及其所有文件内容。 rclone mkdir - 创建目录。 rclone rmdir - 删除目录。 rclone rmdirs - 删除指定灵境下的空目录。如果加上 --leave-root 参数,则不会删除根目录。 rclone check - 检查源和目的地址数据是否匹配。 rclone ls - 列出指定路径下的所有的文件以及文件大小和路径。 rclone lsl - 比上面多一个显示上传时间。 rclone lsd 列出指定路径下的目录 rclone lsf - 列出指定路径下的目录和文件4.常用参数-n = --dry-run - 测试运行,用来查看 rclone 在实际运行中会进行哪些操作。 -P = --progress - 显示实时传输进度,500mS 刷新一次,否则默认 1 分钟刷新一次。 --cache-chunk-size SizeSuffi - 块的大小,默认5M,理论上是越大上传速度越快,同时占用内存也越多。如果设置得太大,可能会导致进程中断。 --cache-chunk-total-size SizeSuffix - 块可以在本地磁盘上占用的总大小,默认10G。 --transfers=N - 并行文件数,默认为4。在比较小的内存的VPS上建议调小这个参数,比如128M的小鸡上使用建议设置为1。 --config string - 指定配置文件路径,string为配置文件路径。 --ignore-errors - 跳过错误。比如 OneDrive 在传了某些特殊文件后会提示Failed to copy: failed to open source object: malwareDetected: Malware detected,这会导致后续的传输任务被终止掉,此时就可以加上这个参数跳过错误。但需要注意 RCLONE 的退出状态码不会为0。5.文件过滤-exclude - 排除文件或目录。 --include - 包含文件或目录。 --filter - 文件过滤规则,相当于上面两个选项的其它使用方式。包含规则以 + 开头,排除规则以 - 开头。 文件类型过滤 比如 --exclude "*.bak"、--filter "- *.bak",排除所有 bak 文件。也可以写作。 比如 --include "*.{png,jpg}"、--filter "+ *.{png,jpg}",包含所有 png 和 jpg 文件,排除其他文件。 --delete-excluded 删除排除的文件。需配合过滤参数使用,否则无效。 目录过滤 目录过滤需要在目录名称后面加上 /,否则会被当做文件进行匹配。以 / 开头只会匹配根目录(指定目录下),否则匹配所目录。这同样适用于文件。 --exclude ".git/" 排除所有目录下的.git 目录。 --exclude "/.git/" 只排除根目录下的.git 目录。 --exclude "{Video,Software}/" 排除所有目录下的 Video 和 Software 目录。 --exclude "/{Video,Software}/" 只排除根目录下的 Video 和 Software 目录。 --include "/{Video,Software}/**" 仅包含根目录下的 Video 和 Software 目录的所有内容。 文件大小过滤 默认大小单位为 kBytes ,但可以使用 k ,M 或 G 后缀。 --min-size 过滤小于指定大小的文件。比如 --min-size 50 表示不会传输小于 50k 的文件。 --max-size 过滤大于指定大小的文件。比如 --max-size 1G 表示不会传输大于 1G 的文件。
2021年04月11日
65 阅读
0 评论
0 点赞