| 
 
| 本帖最后由 xxzx01 于 2015-8-21 19:31 编辑 
 感谢论坛里的大神,我的方法都是参考他们的,我只是一个搬运工,做了一点修改,(注意安装aria2的一条命令有错,已经修改过)一、改/etc/apt/sources.list   这样就可以运行apt-get命令,方便安装插件,建议直接用winscp修改,将下面文本直接粘贴就可以,也可以下载附件覆盖原文件
 deb http://anionix.ddns.net wheezy-64k main
 deb http://www.mobibrw.com/deb/wdmycloud/4.0/wheezy wheezy main
 deb http://www.mobibrw.com/deb/wdmycloud/4.0/jessie jessie main
 #deb http://ftp.us.debian.org/debian/ wheezy main
 #deb http://ftp.us.debian.org/debian/ jessie main
 #deb http://ftp.us.debian.org/debian/ sid main
 #deb http://ftp.us.debian.org/debian/ experimental main
 #deb-src http://ftp.us.debian.org/debian/ wheezy main
 #deb-src http://ftp.us.debian.org/debian/ jessie main
 
 
 二、Transmission(安装方法与3.0一样)
 请自行准备WinSCP、putty,并打开MC的SSH
 1、用putty连上MC,用户名root,密码welc0me ,然后按顺序执行以下指令
 apt-get update
 apt-get install transmission-daemon
 /etc/init.d/transmission-daemon stop
 sed -i 's/USER=debian-transmission/USER=root /g' /etc/init.d/transmission-daemon
 
 2、用WinSCP连上MC,用户名root,密码welc0me,打开/etc/transmission-daemon目录,双击settings.json编辑以下几项
 
 #默认下载目录,请自行修改为你要的目录(也可以在下载时修改)
 "download-dir": "/DataVolume/shares/Public/Download",
 
 #UPnP,如果你的路由支持,改为true
 "port-forwarding-enabled": true,
 
 ##RPC
 #如果你需要远程下载,请修改为true,并设置密码和用户名。如果不需要则为false。
 "rpc-authentication-required": true,
 "rpc-password": "你的密码",
 "rpc-username": "你的用户名",
 
 #白名单
 "rpc-whitelist": "127.0.0.1",
 "rpc-whitelist-enabled": false,
 
 修改完成后保存关闭。
 
 三、WD My Cloud 4.x固件安装百度云自动同步软件(注意syncy已经升级到2.51版,老版本可能无法使用了,升级方法简单,下载附件里的2.51版,用syncy.py覆盖原文件,同时在syncy里添加两条配置就可以了)
 
 1、用任意ssh客户端(putty或者sshclient)登录到Mycloud,用户名root,密码welc0me
 
 2、安装必要的python-pycurl库:(前两个是信赖库)
 apt-get update
 apt-get install libcurl3-gnutls
 apt-get install python-support
 apt-get install python-pycurl
 
 3、修改配置文件syncy
 
 config syncy
 
 option ondup 'rename'
 
 option blocksize '10'
 
 option maxrecvspeed '0'
 
 option syncperiod '0-24'
 
 option retrydelay '3'
 
 option datacache 'on'
 
 option excludefiles '*/Thumbs.db'
 
 option speedlimitperiod '0-0'
 
 option maxsendspeed '0'
 
 option listnumber '100'
 
 option threadnumber '2'
 
 option retrytimes '20'
 
 option syncinterval '7200'
 
 option syncylog ''
 
 option tasknumber '2'
 
 config syncpath
 
 option synctype 'download'   #这个选项只下载,如果要同步把download改为sync
 
 option enable '1'
 
 option localpath '/DataVolume/shares/Public/baiduyun'
 
 option remotepath '/downloads'
 #下面两条配置是2.51版需要新添加
 option encryption '0'             # 0 is disable encryption
 option encryptkey 'This is a encrypt key'
 
 #注意这个download目录在,百度盘--我的应用数据--SyncY--download,这个要特别注意
 4、安装SyncY:(建议下载附件里的最新版,syncy.py是执行文件,syncy是配置文件),可以使用winscp,在etc下建立config目录
 复制配置文件syncy到/etc/config目录下,复制syncy.py到/usr/bin目录下,授予syncy.py可执行权限(chmod a+r /usr/bin/syncy.py);
 
 也可以运行下面命令        cp syncy.py /usr/bin
 chmod a+r /usr/bin/syncy.py
 mkdir /etc/config
 cp syncy  /etc/config
 (注,同步时间设为2个小时,如要修改,修改 syncinterval 后面的数字,单位是秒,建议同步时间设为1个小时以上,太短会造成不休眠)
 
 7、运行/usr/bin/syncy.py。首次运行会获得一个用户码,打开https://openapi.baidu.com/device后输入用户码得到百度云的授权后即可以进行同步了。
 
 8、退出syncy.py后重启,百度云将会对apps/syncY目录里的内容自动同步到Mycloud里。
 
 9、如何在后台运行syncY:ssh后执行:
 
 # nohup /usr/bin/syncy.py &
 
 之后就可把ssh窗口关掉,只要不重启Mycloud,就一直在运行,重启的话,再执行这条命令即可。
 设置随机启动:
 
 第一步 在debian的初始目录init.d下建立rc2.local档
 
 cp /etc/rc.local /etc/init.d/rc2.local
 
 第二步 在rc2.local文件中 exit 0 一行前插入
 # nohup /usr/bin/syncy.py &
 (可以用前面的提到的winscp软件直接修改)
 第三步 设置启动级别
 update-rc.d rc2.local start 99 2 3 4 5 . stop 01 0 1 6 .
 
 也可以去掉了开机自动启动
 update-rc.d -f rc2.local remove
 然后需要的时候,自己启动这个
 nohup /usr/bin/syncy.py &
 
 这样,关了PUTTY进程仍会运行
 
 如何关闭百度云同步
 ps -ef
 查找python /usr/bin/syncy.py  前面的数字(如14158)
 kill -s 9  14158
 
 
 四、安装aria2
 
 
 1、安装软件
 apt-get update
 apt-get install aria2
 apt-get install libc-ares2
 
 2,生成aria2.conf文件(由于保存aria2运行记录),用putty输入下面命令
 mkdir /etc/aria2/
 touch /etc/aria2/aria2.conf
 touch /etc/aria2/aria2-log.log
 
 3,编辑aria2.conf文件(配置文件),也可以下载附件
 vi /etc/aria2/aria2.conf    #建议用winscp修改
 #Aria2 configuration
 # RPC Setting
 #用户名
 rpc-user=user
 #密码
 rpc-passwd=pwd
 #允许rpc
 enable-rpc=true
 #允许非外部访问
 rpc-listen-all=true
 #允许所有来源, web界面跨域权限需要
 rpc-allow-origin-all=true
 #RPC端口, 仅当默认端口被占用时修改
 #rpc-listen-port=6800
 # General Setting
 #文件保存路径, 默认为当前启动位置
 dir=/shares/TDdownload
 input-file=/etc/aria2/aria2.session
 save-session=/etc/aria2/aria2.session
 #定时保存会话,需要1.16.1之后的release版
 save-session-interval=60
 #日志路径
 #log=/etc/aria2/aria2-log.log
 #日志级别
 #log-level=warn
 #event-poll=select
 #文件缓存, 使用内置的文件缓存, 如果你不相信Linux内核文件缓存和磁盘内置缓存时使用, 需要1.16及以上版本
 disk-cache=8M
 #另一种Linux文件缓存方式, 使用前确保您使用的内核支持此选项, 需要1.15及以上版本
 #enable-mmap=true
 #文件预分配, 能有效降低文件碎片, 提高磁盘性能. 缺点是预分配时间较长
 #所需时间 none < falloc ? trunc << prealloc,falloc和trunc需要文件系统和内核支持
 file-allocation=none
 #特性
 peer-id-prefix=-UT2210-
 user-agent=uTorrent/2210(25130)
 # Connection Setting
 
 #断点续传
 continue=true
 #同服务器连接数
 max-connection-per-server=5
 #最大同时下载数(任务数), 路由建议值: 3
 max-concurrent-downloads=3
 #最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要
 min-split-size=10M
 #单文件最大线程数, 路由建议值: 5
 split=5
 #下载速度限制
 #max-overall-download-limit=150K
 #上传速度限制
 #max-overall-upload-limit=50K
 #单文件下载速度限制
 #max-download-limit=150K
 #单文件速度限制
 #max-upload-limit=20K
 #断开速度过慢的连接
 lowest-speed-limit=1K
 auto-save-interval=120
 check-certificate=false
 # BT/PT Setting
 #强制加密, 防迅雷必备
 bt-require-crypto=true
 #单种子最大连接数
 bt-max-peers=55
 enable-peer-exchange=true
 #启用本地节点查找
 bt-enable-lpd=true
 #不确定是否需要,为保险起见,need more test
 enable-dht=true
 #监听端口
 listen-port=48028
 dht-listen-port=48028
 #当下载的文件是一个种子(以.torrent结尾)时, 自动下载BT
 follow-torrent=true
 #保存会话
 force-save=true
 bt-seed-unverified=true
 bt-save-metadata=true
 bt-hash-check-seed=true
 bt-remove-unselected-file=false
 bt-stop-timeout=900
 #修改做种设置, 允许做种
 seed-ratio=1
 seed-time=5
 disable-ipv6=true
 
 
 4、建议使用 –conf-path 来指定配置文件
 
 用winscp修改/etc/init.d/rc.local文件内容为
 #! /bin/sh
 aria2c --conf-path=/etc/aria2/aria2.conf  -D
 
 
 
 保存后
 运行  chmod 777 /etc/init.d/rc.local
 运行  update-rc.d rc.local start 98 2 3 4 5 .    (这天命令最后有个点.  别漏了
 
 配置文件的内容参考
 
 http://www.right.com.cn/forum/thread-142169-1-1.html
 5,添加下载
 打开控制台http://app.baotuba.com/yaaw/ 改上自己的ip 端口默认6800
 
 使用Aria2下载百度网盘和115的资源
 https://blog.icehoney.me/posts/2015-1-31-Aria2-download
 
 
 
 
 
 
 
 
 
 | 
 评分
查看全部评分
 |