安装与运行

安装

有两个方法可以安装 autoremove-torrents。强烈推荐使用pip安装。

从 pip 安装

pip install autoremove-torrents

从 GitHub 安装

git clone https://github.com/jerrymakesjelly/autoremove-torrents.git
cd autoremove-torrents
python3 setup.py install

运行

只需在你的终端中输入以下命令:

autoremove-torrents

autoremove-torrents 会在当前工作目录中寻找 config.yml 文件。有关更多命令行参数,请查看下面的表格。

参数列表

注解

如果你使用参数的全名,你需要用等号来引出参数的值;不过,如果你使用参数的缩写,你只需要用一个空格把参数的值引出来。

参数名 参数缩写 描述
–view -v 运行并查看有哪些种子可以删除,但不要真正地删除它们。
–conf -c 指定配置文件的路径。
–task -t 运行指定的任务。参数值就是要执行的任务名。
–log -l 指定日志文件的路径。
–debug -d Enable debug mode and output more logs.

例如:

autoremove-torrents --view --conf=/home/myserver/autoremove-torrents/config.yml

它等价于:

autoremove-torrents -v -c /home/myserver/autoremove-torrents/config.yml

卸载

通过 pip 卸载

如果你的 autoremove-torrents 是通过 pip 安装的,你就可以用 pip 简单地卸载掉它:

pip uninstall autoremove-torrents

手动卸载

然而,如果你的 autoremove-torrents 是通过 setup.py 安装的,你需要手动地删除所有的文件。

第一步

cd autoremove-torrents

第二步

重新安装这个程序并记录复制了哪些文件:

python3 setup.py install --record files.txt

第三步

xargs 去删除文件:

cat files.txt | xargs rm -rf

或者,如果你在用 Windows,可以使用 Powershell:

Get-Content files.txt | ForEach-Object {Remove-Item $_ -Recurse -Force}

参考:https://stackoverflow.com/questions/1550226/python-setup-py-uninstall