torrent-sync works good now
This commit is contained in:
parent
b4e4e9850b
commit
d2008a09e5
4 changed files with 58 additions and 6 deletions
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
./rbackup.nix
|
./rbackup.nix
|
||||||
./sync-torrent.nix
|
./sync-torrent.nix
|
||||||
|
./sync-script.nix
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
43
nixos/machines/chungus/sync-script.nix
Normal file
43
nixos/machines/chungus/sync-script.nix
Normal 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"
|
||||||
|
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
let
|
let
|
||||||
uiPort = 9099;
|
uiPort = 9099;
|
||||||
|
announceIp = "10.23.42.28";
|
||||||
|
peerPort = 51433;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -43,9 +45,9 @@ in
|
||||||
|
|
||||||
# "normal" speed limits
|
# "normal" speed limits
|
||||||
speed-limit-down-enabled = false;
|
speed-limit-down-enabled = false;
|
||||||
speed-limit-down = 800;
|
speed-limit-down = 1000;
|
||||||
speed-limit-up-enabled = true;
|
speed-limit-up-enabled = true;
|
||||||
speed-limit-up = 3000;
|
speed-limit-up = 1000;
|
||||||
upload-slots-per-torrent = 8;
|
upload-slots-per-torrent = 8;
|
||||||
# Queuing
|
# Queuing
|
||||||
# When true, Transmission will only download
|
# When true, Transmission will only download
|
||||||
|
@ -66,10 +68,12 @@ in
|
||||||
seed-queue-size = 10;
|
seed-queue-size = 10;
|
||||||
|
|
||||||
# Enable UPnP or NAT-PMP.
|
# Enable UPnP or NAT-PMP.
|
||||||
peer-port = 51413;
|
peer-port = peerPort;
|
||||||
port-forwarding-enabled = false;
|
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;
|
start-added-torrents = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
let
|
let
|
||||||
uiPort = 9099;
|
uiPort = 9099;
|
||||||
|
announceIp = "10.23.42.111";
|
||||||
|
peerPort = 51433;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -66,10 +68,12 @@ in
|
||||||
seed-queue-size = 10;
|
seed-queue-size = 10;
|
||||||
|
|
||||||
# Enable UPnP or NAT-PMP.
|
# Enable UPnP or NAT-PMP.
|
||||||
peer-port = 51413;
|
peer-port = peerPort;
|
||||||
port-forwarding-enabled = false;
|
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;
|
start-added-torrents = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue