5 Star 117 Fork 5

八神 / linux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
transmission运行脚本.txt 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
Scripts
Start/Stop? ?
init.d script (Debian, Ubuntu and BSD deratives)
runscript (Gentoo and other runscript compatible systems)
On Torrent Completion
Transmission can be set to invoke a script when downloads complete.
The environment variables supported are:
TR_APP_VERSION
TR_TIME_LOCALTIME
TR_TORRENT_DIR
TR_TORRENT_HASH
TR_TORRENT_ID
TR_TORRENT_NAME
首先要改变transmission运行的用户:
vi /etc/init.d/transmission-daemon
USER=XXX
配置文件权限: chown xxx:xxx /etc/transmission-daemon/settings.json
当设定好运行脚本后,要注意:
当执行脚本时,当前工作目录为 /目录,一此读写可能不能正常,shell脚本能
正常工作,当运行python脚本时,import非标准库时,由于当前工作目录的关系,
会发生导入模块失败,及文件读写失败,可用:1. shell脚本中用cd xxx,然后
调用 python xxx.py (试过成功); 2. 直接用python script, 但在最先加入:
os.chdir(os.path.dirname(os.path.realpath(__file__)))来改变当前工作目录,
从而能够找到相关模块。
VimL
1
https://gitee.com/wucai0503/linux.git
git@gitee.com:wucai0503/linux.git
wucai0503
linux
linux
master

搜索帮助