torrent-sync works good now

This commit is contained in:
Ingolf Wagner 2023-05-04 19:35:15 +02:00
parent b4e4e9850b
commit d2008a09e5
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
4 changed files with 58 additions and 6 deletions

View file

@ -32,6 +32,7 @@
./rbackup.nix
./sync-torrent.nix
./sync-script.nix
];

View file

@ -0,0 +1,43 @@
# [ nix-shell:/media/music ]# transmission-create -o ~/first.torrent "Zardonic - Antihero (2015)" -t http://robi.private:6969/announce
# Creating
# torrent "/root/first.torrent" .... done!
#
# [nix-shell:/media/music]# transmission-remote sync.chungus.private:80 -a ~/first.torrent --download-dir /media/music
# sync.chungus.private:80/transmission/rpc/ responded: "success"
#
# [nix-shell:/media/music]# transmission-remote sync.robi.private:80 -a ~/first.torrent --download-dir /media/music
# sync.robi.private:80/transmission/rpc/ responded: "success"
#
#
{pkgs, ...}:
{
environment.systemPackages = [
(pkgs.writers.writeBashBin "torrent-sync" ''
set -e
set -x
file_folder=$( realpath "$1" )
folder=$( dirname "$file_folder" )
file=$( basename "$file_folder" )
pushd "$folder"
${pkgs.transmission}/bin/transmission-create \
-t udp://robi.private:6969/announce \
-o ~/last.torrent \
"$file"
popd
${pkgs.transmission}/bin/transmission-remote \
sync.chungus.private:80 \
-a ~/last.torrent \
--download-dir "$folder"
${pkgs.transmission}/bin/transmission-remote \
sync.robi.private:80 \
-a ~/last.torrent \
--download-dir "$folder"
'')
];
}

View file

@ -1,6 +1,8 @@
{ lib, pkgs, config, ... }:
let
uiPort = 9099;
announceIp = "10.23.42.28";
peerPort = 51433;
in
{
@ -43,9 +45,9 @@ in
# "normal" speed limits
speed-limit-down-enabled = false;
speed-limit-down = 800;
speed-limit-down = 1000;
speed-limit-up-enabled = true;
speed-limit-up = 3000;
speed-limit-up = 1000;
upload-slots-per-torrent = 8;
# Queuing
# When true, Transmission will only download
@ -66,10 +68,12 @@ in
seed-queue-size = 10;
# Enable UPnP or NAT-PMP.
peer-port = 51413;
peer-port = peerPort;
port-forwarding-enabled = false;
# Start torrents as soon as they are added
announce-ip = announceIp;
announce-ip-enabled = true;
# Start torrents as soon as they are added
start-added-torrents = true;
};

View file

@ -1,6 +1,8 @@
{ lib, pkgs, config, ... }:
let
uiPort = 9099;
announceIp = "10.23.42.111";
peerPort = 51433;
in
{
@ -66,10 +68,12 @@ in
seed-queue-size = 10;
# Enable UPnP or NAT-PMP.
peer-port = 51413;
peer-port = peerPort;
port-forwarding-enabled = false;
# Start torrents as soon as they are added
announce-ip = announceIp;
announce-ip-enabled = true;
# Start torrents as soon as they are added
start-added-torrents = true;
};