Skip to content

Commit

Permalink
downloads/complete folder & torrents will move there automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
u0398 committed Apr 14, 2021
1 parent c8f89b0 commit 8a69e62
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ RUN apk add --no-cache \
#/socket \
/watch/load \
/watch/start \
/downloads && \
/downloads \
/downloads/complete && \
# Forward Info & Error logs to std{out,err} (à la nginx)
ln -sf /dev/stdout /var/log/rtorrent-info.log && \
ln -sf /dev/stderr /var/log/rtorrent-error.log
Expand Down
27 changes: 18 additions & 9 deletions root/dist/.rtorrent.rc.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
#############################################################################

# Instance layout (base paths)
method.insert = cfg.basedir, private|const|string, (cat,"/")
method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"download/")
method.insert = cfg.session, private|const|string, (cat,(cfg.basedir),"session/")
method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/")
method.insert = cfg.socketdir, private|const|string, (cat,(cfg.basedir),"socket/")
method.insert = cfg.logs, private|const|string, (cat,"/var/log/")
method.insert = cfg.info_logfile, private|const|string, (cat,(cfg.logs),"rtorrent-info.log")
method.insert = cfg.error_logfile, private|const|string, (cat,(cfg.logs),"rtorrent-error.log")
#method.insert = cfg.socketfile, private|const|string, (cat,(cfg.socketdir),"rtorrent.sock")
method.insert = cfg.basedir, private|const|string, (cat,"/")
method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"download/")
method.insert = cfg.download_complete, private|const|string, (cat,(cfg.download),"complete/")
method.insert = cfg.session, private|const|string, (cat,(cfg.basedir),"session/")
method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/")
method.insert = cfg.socketdir, private|const|string, (cat,(cfg.basedir),"socket/")
method.insert = cfg.logs, private|const|string, (cat,"/var/log/")
method.insert = cfg.info_logfile, private|const|string, (cat,(cfg.logs),"rtorrent-info.log")
method.insert = cfg.error_logfile, private|const|string, (cat,(cfg.logs),"rtorrent-error.log")
#method.insert = cfg.socketfile, private|const|string, (cat,(cfg.socketdir),"rtorrent.sock")

# Move logging higher in the config file for easier debugging
# Logging:
Expand Down Expand Up @@ -99,6 +100,14 @@ schedule2 = watch_load, 11, 10, ((load.verbose, (cat, (cfg.watch), "load/*.torre
## Add & download straight away
schedule2 = watch_start, 10, 10, ((load.start_verbose, (cat, (cfg.watch), "start/*.torrent")))

# Move finished (no need for Autotools/Automove plugin on ruTorrent)
method.insert = d.get_finished_dir, simple, "cat=$cfg.download_complete=,$d.custom1="
method.insert = d.move_to_complete, simple, "d.directory.set=$argument.1=; execute=mkdir,-p,$argument.1=; execute=mv,-u,$argument.0=,$argument.1=; d.save_full_session="
method.set_key = event.download.finished,move_complete,"d.move_to_complete=$d.data_path=,$d.get_finished_dir="

# Erase data when torrent deleted (no need erasedata plugin on ruTorrent)
method.set_key = event.download.erased,delete_erased,"execute=rm,-rf,--,$d.data_path="

## Run the rTorrent process as a daemon in the background
system.daemon.set = true

Expand Down

0 comments on commit 8a69e62

Please sign in to comment.