1

我正在尝试获取 txt 文件的内容并将该内容设置为 rtorrent 的自定义移动目录。这是我在 rtorrent.rc 中的内容:

system.method.insert = d.get_loaded_basename,string|simple,"execute_capture=bash,-c,\"cat /files/id.txt\",cleanbase,$d.get_loaded_file="

# insert another method to concatenate the final destination directory with the basename
system.method.insert = d.get_meta_path,simple,"cat=/files/complete/,$d.get_loaded_basename="

#watch and set custom path
schedule = watch_1,15,15,"load_start=/files/watch/*.torrent,d.set_custom1=$d.get_meta_path="

#move file to custom path and execute script
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.set_custom1=;execute=mv,-u,$d.get_base_path=,$d.set_custom1=;execute=/files/script.sh {pass ID#}"

id.txt 文件有一个数字,例如 123。因此对于这种情况,文件应该移动到 /files/complete/123/。id.txt 中的数字各不相同。另外,我想将 ID 号作为参数传递给 script.sh。我怎样才能做到这一点?

4

0 回答 0