Pause all torrents in transmission-daemon on reboot/power cycle

in case of a power outage,

once power is back, and the router reboots

i would like,

either,

to run a script at boot (that will check the time and pause all torrents or not) for transmission-daemon

or

to just pause all torrents that were running in transmission-daemon before the power outage

thanks

edit: im on OpenWrt 21.02.3 r16554-1d4dea6d4f

Is EOL, you should upgrade.

Don't autostart the transmission service on boot ?

1 Like

this version is stable and best performance on my device, latest isn't, unfortunately (but id rather not debate it in this thread :/)

Oooo, never thought of this, nice!
Will disable it i startup and then launch it manually! Will be a pain to restart it manually since a lot of power cuts, but is definitely a option, thanks

Is there any other way you would suggest?

There's probably a setting in transmission so it won't auto resume old torrents when started.

1 Like

no, at least, i haven't seen it in in json settings or transmission luci
there is an option "Automatically start added torrents" which Ive unchecked

{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": false,
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 2,
    "dht-enabled": true,
    "download-dir": "/ok/share/downloads",
    "download-queue-enabled": true,
    "download-queue-size": 4,
    "encryption": 1,
    "idle-seeding-limit": 1,
    "idle-seeding-limit-enabled": true,
    "incomplete-dir": "/ok/share/temp",
    "incomplete-dir-enabled": true,
    "invalid-key": false,
    "lazy-bitfield-enabled": true,
    "lpd-enabled": false,
    "message-level": 1,
    "peer-congestion-algorithm": "",
    "peer-id-ttl-hours": 6,
    "peer-limit-global": 240,
    "peer-limit-per-torrent": 60,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": "default",
    "pex-enabled": true,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "prefetch-enabled": false,
    "queue-stalled-enabled": true,
    "queue-stalled-minutes": 30,
    "ratio-limit": 0,
    "ratio-limit-enabled": true,
    "rename-partial-files": true,
    "rpc-authentication-required": false,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-host-whitelist": "",
    "rpc-host-whitelist-enabled": false,
    "rpc-password": "{jjj",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "",
    "rpc-whitelist": "127.0.0.1,::1",
    "rpc-whitelist-enabled": false,
    "scrape-paused-torrents-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "seed-queue-enabled": false,
    "seed-queue-size": 10,
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 100,
    "speed-limit-up-enabled": false,
    "start-added-torrents": false,
    "trash-original-torrent-files": true,
    "umask": 18,
    "upload-slots-per-torrent": 14,
    "utp-enabled": true,
    "watch-dir-enabled": false
}

No access to transmission atm, but another option might be to set the max UL and DL speeds to 0.

1 Like

if I set max upload and max download to 0

then activate alternative speed limit of up/dl to say 100 and the power goes out

when the router boots back up, alternative speed limits is still activated

but, this too, nice,

i currently am using

transmission-remote --torrent all --start

and

transmission-remote --torrent all --stop

to start and stop torrent download between 12am to 6am

problem is if the power goes out at 5:55am and power comes back at 6:05am it will continue downloading

Edit:
No, wait, alternative speed limits turns off on boot, nice, this too is a great option, thanks, let me know if you think of anything else, thanks

thanks, this works and is a cleaner solution!

is there a better way,

this way,

im giving out my ip to all the peers of those torrents all day although im up 0 and dl 0

:frowning:

Edit:
ok, so it doesn't

https://search.brave.com/search?q=does+transmission-daemon+show+peers+my+public+ip+address+when+upload+limit+and+download+limit+are+set+to+0&source=web&summary=1&summary_og=5d162b84488f77e23fa06e

You can always handle it all through a firewall rule, no need to play around with the transmission settings at all.

1 Like

ok, that would be best, can you help me as to how i can do that, thanks

You probably already have a rule for allowing the transmission traffic through the firewall?

1 Like

no, i havent made any rules for transmission, port is always closed, but it still works :grimacing:

do you mean something like this with timer settings

this seems the best solution atm!

Drop all outgoing traffic on whatever transmission ports you use.

1 Like

thank you, appreciate your time :slight_smile:

Security is part of the stability for any device, especially if you're adding server tasks with a huge attack surface to the outside (transmission), it's not optional (even if that may entail a hardware replacement, the used markets might come in handy).

1 Like

noted, moving back to the pi for things like transmission
router is on the latest build

thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.