使用Aira2下载文件后自动上传到GoogleDrive网盘onedrive

更新 【2018.10.30】 这里分享下萌咖大佬的Aira2上传脚本,不过是精简版,全能版暂不分享,精简版包含以下功能: 1、脚本适用于Rclone挂载的网盘,比如Onedrive/Google Drive等。 2、判断上传文件的文件大小区间。 限制最低上传大小:可防止产生的.aria2后缀文件一起上传到网盘。 限制最高文件大小:适用于Onedrive等,官方限制上传不能超过15G,其它可自行更改其数值。 3、支持文件名中包含空格等特殊字符。 脚本说明: Aria2 一键安装管理脚本 系统支持: CentOS6+ / Debian6+ / Ubuntu14+ wget -N --no-check-certificate https://raw.githubusercontent.com/ojbk8/doubi/master/aria2.sh && chmod +x aria2.sh && bash aria2.sh Aria2下载为什么会多出一个.aria2后缀的文件? 找到force-save参数,进行设置 force-save=true 会保存文件下载历史,但会在下载目录产生同名.aria2文件 force-save=false不产生同名.aria2文件,同时也不能能保存下载历史 使用方法 原理是当下载完后aria2会给脚本传3个参数$1、$2、$3分别为gid、文件数量、文件路径。我们对文件路径这个字符串处理一番就可以达到目的了。 新建脚本文件rcloneupload.sh并复制下面代码: #!/bin/bash downloadpath='/root/Download' #需要上传的目录,Aria2下载目录 name='rclonename' #配置Rclone时填写的name folder='/rclone' #网盘里的文件夹,留空为整个网盘。 MinSize='0.01k' #限制最低上传大小,默认10k,BT下载时可防止上传其他无用文件。会删除文件,谨慎设置。 MaxSize='15G' #限制最高文件大小,默认15G,OneDrive上传限制。 filepath=$3 #Aria2传递给脚本的原始路径,如果是单文件则为/root/Download/1.mp4,如果是文件夹则该值为文件夹内第一个文件比如/root/Download/a/b/1.mp4 rdp=${filepath#${downloadpath}/} #路径转换,去掉开头的下载路径。 path=${downloadpath}/${rdp%%/*} #文件或文件夹路径。如果是单个文件,应与原始路径一致。 if [ $2 -eq 0 ] then exit 0 fi while true; do if [ "$path" = "$filepath" ] && [ $2 -eq 1 ] #如果下载的是单个文件 then rclone move -v "$filepath" ${name}:${folder} --min-size $MinSize --max-size $MaxSize rm -vf "$filepath".aria2 #删除残留的.aria.2文件 exit 0 elif [ "$path" != "$filepath" ] #如果下载的是文件夹 then while [[ "`ls -A "$path/"`" != "" ]]; do rclone move -v "$path" ${name}:"${folder}"/"${rdp%%/*}" --min-size $MinSize --max-size $MaxSize --delete-empty-src-dirs rclone delete -v "$path" --max-size $MinSize #删除多余的文件 rclone rmdirs -v "$downloadpath" --leave-root #删除空目录,--delete-empty-src-dirs参数已实现,加上无所谓。 done rm -vf "$path".aria2 #删除残留的.aria2文件 exit 0 fi done 或者 ...

四月 11, 2018 · admin

hexo同步布署在github-coding并实现国内外自动分流

建议单独托管在github上,因为国内大环境背景下,你懂的啦! 域名解析 登陆DNSPOD控制台 在域名添加2条记录值 记录类型 线路类型 记录值 CNAME 国外 username.github.io CNAME 国内 username.coding.me ...

三月 29, 2018 · admin

Crontab定时执行计划任务

crond简介 crond是linux定时执行计划任务 Linux下的任务调度分为两类,系统任务调度和用户任务调度。 系统任务 配置文件/etc/crontab nano /etc/crontab 用户任务 crontab -e crontab文件的含义 用户所建立的crontab文件中,每一行都代表一项任务,每行的每个字段代表一项设置,它的格式共分为六个字段,前五段是时间设定段,第六段是要执行的命令段,格式如下: minute hour day month week command 其中: minute: 表示分钟,可以是从0到59之间的任何整数。 hour:表示小时,可以是从0到23之间的任何整数。 day:表示日期,可以是从1到31之间的任何整数。 month:表示月份,可以是从1到12之间的任何整数。 week:表示星期几,可以是从0到7之间的任何整数,这里的0或7代表星期日。 command:要执行的命令,可以是系统命令,也可以是自己编写的脚本文件。 在以上各个字段中,还可以使用以下特殊字符: 星号(*):代表所有可能的值,例如month字段如果是星号,则表示在满足其它字段的制约条件后每月都执行该命令操作。 逗号(,):可以用逗号隔开的值指定一个列表范围,例如,“1,2,5,7,8,9” 中杠(-):可以用整数之间的中杠表示一个整数范围,例如“2-6”表示“2,3,4,5,6” 正斜线(/):可以用正斜线指定时间的间隔频率,例如“0-23/2”表示每两小时执行一次。同时正斜线可以和星号一起使用,例如*/10,如果用在minute字段,表示每十分钟执行一次。 管理crontab进程 重启 /etc/init.d/cron restart 或者 systemctl restart cron 或者 systemctl restart cron.service 状态查询 service cron status 或者 systemctl status cron 列出crontab文件 crontab -l 删除crontab文件 crontab -r 开启crontab日志 编辑文件/etc/rsyslog.conf将#cron.* /var/log/cron.log去掉前面的# sed -i 's/#cron/cron/' /etc/rsyslog.conf 重启rsyslog service rsyslog restart 查看crontab开启日志 cat /var/log/cron.log 解决(CRON) info (No MTA installed, discarding output)错误crontab不执行,方法是在后面加上>/dev/null 2>&1不需要保留执行的输出,重定向到null中,例如: ...

一月 25, 2018 · admin

Debian/Ubuntu系统手动更新内核并启用TCP BBR拥塞控制算法

查看内核版本 uname -r BBR要求内核为kernel4.9以上版本。 如果大于或等于4.9的可以直接开启BBR,开启步骤如下 配置文件 echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf 加载配置到内核参数中 sysctl -p sysctl net.ipv4.tcp_available_congestion_control 顺利的话下面的命令就能看到bbr模块了 lsmod | grep bbr sysctl net.ipv4.tcp_available_congestion_control 返回值一般为: net.ipv4.tcp_available_congestion_control = bbr cubic reno sysctl net.ipv4.tcp_congestion_control 返回值一般为: net.ipv4.tcp_congestion_control = bbr sysctl net.core.default_qdisc 返回值一般为: net.core.default_qdisc = fq 如果内核版本低于4.9的需要手动升级到4.9或以上才能开启 去这里下载最新版的内核 deb 安装包 如果系统是 64 位,则下载 amd64 的 linux-image 中含有 generic 这个 deb 包; 如果系统是 32 位,则下载 i386 的 linux-image 中含有 generic 这个 deb 包; 安装的命令如下(以最新版的 64 位 4.12.4 举例而已,请替换为下载好的 deb 包): ...

十二月 21, 2017 · admin

IPv6的VPS连接IPv4和IPv4的VPS免费获取IPv6

只有IPv6的VPS连通IPV4 无ipv4纯ipv6先编辑/etc/resolv.conf改成DNS64地址 nameserver 2001:67c:2b0::4 nameserver 2001:67c:27e4::64 然后执行 chattr +i /etc/resolv.conf service systemd-resolved restart IPV4免费获得IPV6 只有IPV4的VPS通过Hurricane Electric Internet Services免费获得IPV6。 Hurricane Electric Free IPv6 Tunnel Broker 注册 登陆 按提示输入公网IPV4,选择地区区域,获得IPV6。 选择自己VPS的系统对应版本按提示附加上去 enjoy Cloudflare WARP 一键安装脚本 转载自项目地址、Cloudflare WARP 一键安装脚本 使用教程 无论 VPS 是 IPv4 还是 IPv6 又或都有,添加 WARP Wire­Guard 双栈全局网络,直接使用以下 WARP 脚本命令一把梭: # 自动配置 WARP WireGuard 双栈全局网络 bash <(curl -fsSL git.io/warp.sh) d 添加或更改 IPv4/​IPv6 网络中的一个出口走 WARP Wire­Guard 网络,使用以下 WARP 脚本命令一把梭: # 自动配置 WARP WireGuard IPv4 网络 bash <(curl -fsSL git.io/warp.sh) 4 # 自动配置 WARP WireGuard IPv6 网络 bash <(curl -fsSL git.io/warp.sh) 6 其它相关命令: # 查看 WARP 脚本子命令列表 bash <(curl -fsSL git.io/warp.sh) help # 重启 WARP WireGuard 网络接口 systemctl restart wg-quick@wgcf # 禁用 WARP WireGuard 网络接口 systemctl disable wg-quick@wgcf --now

十一月 9, 2017 · admin

Oneindex程序安装失败解决办法

项目地址: https://github.com/donwa/oneindex 功能: 不占用服务器空间,不走服务器流量; 直接列出 OneDrive 目录,文件直链下载。 源码安装运行需求: PHP空间,PHP 5.6+ 需打开curl支持 OneDrive 账号 (个人、企业版或教育版/工作或学校帐户) OneIndex 程序 Oneindex程序安装失败解决办法 打开这个网址https://apps.dev.microsoft.com/#/appList 里面会列出oneindex的应用,点击进去后,会看到你的应用ID(client_ID)。 找到【应用程序机密】,点击【生成新密码】,就会生成一个新的client_secret,然后重新安装时候填这个新的client_secret就可以了

十月 4, 2017 · admin

Linux下tar,unzip,7z,rar压缩带密码解压文件文件夹的使用

tar压缩 压缩多个文件或者文件夹的命令 tar -czvf a.tar.gz(想压缩文件名) 源文件名1 源文件名2 源文件夹1 源文件夹2 参数: c创建一个压缩文件,如果只使用这个参数,不使用 z 参数,那么只会打包,不会压缩 x解开一个压缩文件 z是否使用 gzip 压缩或解压 j是否使用 bzip2 压缩或解压 v显示详细信息 f指定压缩后的文件名,后面要直接跟文件名,所以将 f 参数放到最后 举几个例子: 将a文件夹打包成a.tar但是不压缩 tar cvf a.tar arg 将a文件夹打包成a.tar.gz并使用 gzip 压缩 tar czvf a.tar.gz arg 将a文件夹打包成a.tar.gz并使用bzip2压缩 tar cjvf a.tar.bz2 arg tar解压 Linux下常见的压缩包格式有5种:zip tar.gz tar.bz2 tar.xz tar.Z 其中tar是种打包格式,gz和bz2等后缀才是指代压缩方式:gzip和bzip2 filename.zip的解压: unzip filename.zip filename.tar.gz的解压: tar -zxvf filename.tar.gz 其中zxvf含义分别如下 zgzip压缩格式 xextract解压 vverbose详细信息 ffile(file=archieve)文件 filename.tar.bz2的解压: tar -jxvf filename.tar.bz2 j指bzip2压缩格式 其它选项和tar.gz解压含义相同 filename.tar.xz的解压: tar -Jxvf filename.tar.xz 注意J大写 ...

十月 1, 2017 · admin

Linux安装、使用qBittorrent

qBittorrent是一款常见的BT,PT下载工具, PT下载工具对比 qBittorrent在PT中抢上传有优势 Transmission适合在PT保种,系统资源占用少点 安装qBittorrent 添加软件源 add-apt-repository ppa:qbittorrent-team/qbittorrent-stable 按ENTER回车键添加软件源 【可选】如出现add-apt-repository command not found的解决方法 apt-get install software-properties-common 安装qBittorrent Webui apt-get update apt-get install qbittorrent qbittorrent-nox -y 启动软件 qbittorrent-nox & 访问 http://localhost:8080 来控制qBittorrent The Web UI administrator user name is: admin Web 用户界面管理员密码设置为默认密码:adminadmin 存在安全风险!请考虑在设置更改密码! 指定端口: qbittorrent-nox --webui-port=XXXX 命令是在当前窗口下启动的,如果窗口关闭也就跟着一同关闭了,所有需要后台运行,完整命令如下: qbittorrent-nox --webui-port=8899 & 添加qbittorrent-nox开机自动启动 创建qbittorrent-nox启动服务 echo "[Unit] Description=qbittorrent-nox After=network.service [Service] Type=simple User=root Group=root ExecStart=/usr/bin/qbittorrent-nox PrivateTmp=true Restart=on-failure [Install] WantedBy=multi-user.target" > /etc/systemd/system/qbittorrent-nox.service 启动qbittorrent-nox systemctl daemon-reload systemctl enable qbittorrent-nox.service systemctl start qbittorrent-nox.service qBittorrent身份认证失败次数过多,您的 IP 地址已被封禁。 重启qbittorrent-nox ...

九月 22, 2017 · admin

Telegram解锁+86聊天,加机器人spambot进行解锁.

Telegram Sorry, you can only send messages to mutual contacts at the moment. MORE INFO OK Telegram 抱歉,您目前只能向相互的联系人发送消息。 更多信息 好的 @SpamBot发送/start Q: Good news, no limits are currently applied to your account. You’re free as a bird! But I can’t message non-contacts! Great. First, please confirm that you will never send this to strangers: - Unsolicited advertising of any kind - Promotional messages - Shocking materials Were you going to do anything like that? A: No, I’ll never do any of this! Q: Great! I’m very sorry if your account was limited by mistake. Please write me some details about your case, I will forward it to the supervisor. Why do you think your account was limited, what went wrong? A: accident Q: Thank you! Your complaint has been successfully submitted. Our team’s supervisors will check it as soon as possible. If this was a mistake, all limitations will be lifted from your account soon. 等待处理… …

九月 4, 2017 · admin

TCP加速bbr魔改plus锐速lotserver一键安装包

整出了一个集合BBR、BBR魔改、BBR plus、锐速四合一的脚本 本脚本支持KVM架构的VPS,不支持OpenVZ。 项目地址:(https://github.com/cx9208/Linux-NetSpeed) 安装 wget https://github.com/ojbk8/Linux-NetSpeed/raw/master/tcp.sh chmod +x tcp.sh ./tcp.sh 先换成对应加速 出现弹窗按TAB键切换选择No回车删除原内核 重启后 ./tcp.sh 开启加速

八月 23, 2017 · admin