Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
30
votes
9
answers
46563
views
command-line tool for a single download of a torrent (like wget or curl)
I'm interested in a single command that would download the contents of a torrent (and perhaps participate as a seed following the download, until I stop it). Usually, there is a torrent-client daemon which should be started separately beforehand, and a client to control (like `transmission-remote`)....
I'm interested in a single command that would download the contents of a torrent (and perhaps participate as a seed following the download, until I stop it).
Usually, there is a torrent-client daemon which should be started separately beforehand, and a client to control (like
transmission-remote
).
But I'm looking for the simplicity of wget
or curl
: give one command, get the result after a while.
imz -- Ivan Zakharyaschev
(15862 rep)
May 5, 2015, 12:01 PM
• Last activity: May 18, 2025, 09:24 PM
3
votes
2
answers
661
views
Systemd service to start only after CIFS mount
I have a little home server (an old PC really) running a few services under Proxmox hypervisor, one of which is the qBittorrent server.  It is installed in a separate LXC container, on an Ubuntu 24.04 base system.  All downloads are saved on a separate local home-made P...
I have a little home server (an old PC really) running a few services
under Proxmox hypervisor, one of which is the qBittorrent server.
It is installed in a separate LXC container, on an Ubuntu 24.04 base system.
All downloads are saved on a separate local home-made PI-based NAS share that is mounted inside the qBittorrent container using CIFS in fstab, on
/mnt/Vault
.
My problem is, every time I need to restart the qBT container, the torrents will throw a "missing files" error, as, I think, the "qBittorrent-nox" service starts quicker than the NAS share gets mounted inside the container.
It seems simply a matter of the qBT service being faster than the mount –
and so it didn't find the necessary files in time.
Afterwards, when I check the mount, it is there,
so I can eliminate any mounting issues, other than not being fast enough.
So, is it possible to somehow define a condition in the qBT service file
to wait and start only after the mount is present?
Here is the service file:
[Unit]
Description=qBittorrent Command Line Client
After=network.target
[Service]
Type=forking
User=root
Group=qbittorrent-nox
UMask=007
ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=8080
Restart=on-failure
[Install]
WantedBy=multi-user.target
I'm thinking the After
directive under the Unit
section,
but I'm not sure.
Somehow, I should maybe incorporate a response from fstab in there,
to confirm that all mounts were successful?
Any ideas how to put this in practice?
My Linux skills are limited, so I'll do my best to follow any proposals.
Radu Erdei
(131 rep)
Dec 22, 2024, 08:13 AM
• Last activity: Dec 22, 2024, 09:00 PM
2
votes
1
answers
148
views
start-stop-daemon does not start because: "process already running"
I have an init script to start qbittorrent-nox on my server. It works fine when I first start the server, but if I shut down the qbittorrent-nox process (`service qbittorrent stop`) it will not start again (`service qbittorrent start`), with this error: process already running. I am sure there is no...
I have an init script to start qbittorrent-nox on my server. It works fine when I first start the server, but if I shut down the qbittorrent-nox process (
service qbittorrent stop
) it will not start again (service qbittorrent start
), with this error:
process already running.
I am sure there is no process running, I looked with ps
. this is the exact command to start:
start-stop-daemon --start --chdir '/home/testuser' --user 'testuser' --chuid 'testuser:testuser' --startas /usr/bin/env HOME="/home/testuser" /usr/bin/qbittorrent-nox
There are no files in /run
related to qbittorrent.
Martin Vegter
(586 rep)
Nov 30, 2024, 06:11 AM
• Last activity: Nov 30, 2024, 07:43 AM
1
votes
1
answers
418
views
dmesg log being flooded by audit, can I somehow prevent it?
I'm torrenting with Transmission GTK. My dmesg log is being flooded by audit, and without knowing what good it is for, I do not even care much, I cannot use dmesg for other purposes. It floods so fast I am even unable to make text selection... Therefore let me excuse for this image: [
Vlastimil Burián
(30505 rep)
Oct 2, 2024, 11:49 AM
• Last activity: Oct 2, 2024, 06:54 PM
4
votes
2
answers
784
views
Program for identifying files from unfinished torrent-downloads?
Are there any programs that can help identify files and directories belonging to unfinished bittorrent-downloads? I've made a mess, and I'm unsure of which downloads are finished and which are not. I could obviously use the bt-client, if I still had the torrent-files, but I don't. I'm therefor looki...
Are there any programs that can help identify files and directories belonging to unfinished bittorrent-downloads? I've made a mess, and I'm unsure of which downloads are finished and which are not. I could obviously use the bt-client, if I still had the torrent-files, but I don't. I'm therefor looking for way to identify *likely* unfinished bt-downloads - doesn't have to be 100% accurate.
I've noticed that bt-clients typically create empty-files, as well as leave files with "holes" (blocks of the file with just NULL-characters), so this could perhaps be a good way to find likely candidates. Sadly, I don't know any good Linux-commands for finding files with blocks of NULLs...
Baard Kopperud
(7253 rep)
Apr 24, 2013, 11:54 PM
• Last activity: Jun 26, 2024, 01:06 PM
1
votes
1
answers
368
views
What Linux filesystems support preallocating entire files to reduce Torrent/Gnutella file fragmentation?
The way I understand it, with the Linux ext3 filesystem at least, when a large file is created, the blocks are not actually allocated on to the disk until data is actually written to that portion of the file. Linux does a similar thing when programs allocate memory, where the allocations are lazy an...
The way I understand it, with the Linux ext3 filesystem at least, when a large file is created, the blocks are not actually allocated on to the disk until data is actually written to that portion of the file. Linux does a similar thing when programs allocate memory, where the allocations are lazy and pages aren't actually allocated until data is written to them, but that's another topic.
When file sharing programs like Bittorrent and Gnutella write to files, they write small blocks in random areas of the file. The Linux filesystem places these portions of the file all over on the disk creating a lot of fragmentation. When writing to several files at once like this, the problem is especially bad. Even selecting preallocate files in the file sharing program doesn't seem to help. Being able to read these files at only 10MB/sec is typical with the amount of fragmentation that results. The filefrag utility can be used to see how many fragments a file has. A file like /var/log/messsages is a good place to test.
With ext3, and I assume most of the other Linux filesystems as well, some data actually has to be written to the entire file in order from beginning to end to actually have a fully allocated file with minimal fragmentation.
I could try mounting an NTFS volume in Linux, but there has to be a better way! There is ext4, btrfs, xfs, jfs, ReiserFS, ExFAT, and even FAT32 to consider! Do any of these preallocate files, or at least have an API that allows doing this without actually having to write data to the entire file first?
Alex Cannon
(186 rep)
Apr 20, 2024, 07:01 PM
• Last activity: Apr 21, 2024, 11:32 AM
5
votes
3
answers
3567
views
Transmission-daemon service spontaneously stops
I've installed, configured and ran transmission-daemon on my CentOS 6 machine using service transmission-daemon start This works nicely, and I can see the web interface on `http://server.ip:9091` as I need to. The problem is, that several minutes later, it spontaneously stops. Never says anything, w...
I've installed, configured and ran transmission-daemon on my CentOS 6 machine using
service transmission-daemon start
This works nicely, and I can see the web interface on
http://server.ip:9091
as I need to. The problem is, that several minutes later, it spontaneously stops. Never says anything, without warning or error message.
This happens even when I have no torrents active at all (as in, none on the list).
I have no idea what's wrong, and the error logs I thought of (which probably isn't much) show nothing.
How can I diagnose the causes for this? Has anyone else experienced a similar problem?
## EDIT
After the suggestion Martin gave me, I got the log. It goes like this:
[03:07:02.182] Transmission 2.13 (11501) started (session.c:624)
[03:07:02.182] RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:789)
[03:07:02.182] RPC Server Serving RPC and Web requests on port 9091 (rpc-server.c:962)
[03:07:02.182] DHT Generating new id (tr-dht.c:384)
[03:07:02.182] Using settings from "/var/lib/transmission/.config/transmission-daemon" (daemon.c:483)
[03:07:02.182] Saved "/var/lib/transmission/.config/transmission-daemon/settings.json" (bencode.c:1683)
[03:07:10.182] Port Forwarding State changed from "Not forwarded" to "???" (port-forwarding.c:95)
[03:07:18.188] Searching for web interface file "/var/lib/transmission/.local/share/transmission/web/index.html" (platform.c:526)
[03:07:18.188] Searching for web interface file "/usr/share/transmission/web/index.html" (platform.c:526)
[03:07:24.189] DHT Attempting bootstrap from dht.transmissionbt.com (tr-dht.c:241)
It hangs on that last one until it dies. Now I've looked into [this question](https://askubuntu.com/questions/135178/transmission-remote-gui-setup-hangs-on-dht-attempting-to-bootstrap) , but my settings file is already owned by transmission
, and even changing the permissions on the file to 775
didn't seem to have any effects.
Any ideas?
Madara's Ghost
(151 rep)
Sep 4, 2014, 10:20 PM
• Last activity: Dec 21, 2023, 07:25 PM
5
votes
3
answers
16396
views
Move completed torrents in rTorrent according to label
I've got a seedbox with rTorrent (and ruTorrent) installed, and I'm trying to automate as much as possible... Currently, I've got this in my rtorrent.rc to move completed files to ~/Download: system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,~/Download/;d...
I've got a seedbox with rTorrent (and ruTorrent) installed, and I'm trying to automate as much as possible...
Currently, I've got this in my rtorrent.rc to move completed files to ~/Download:
system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,~/Download/;d.set_directory=~/Download/"
And then I've got a script that rsyncs those completed files back to my home computer...
I've got ruTorrent set to apply labels to torrents, and I'd like to move files according to the labels instead of moving them all to the same folder. I can't find any documentation at all, though. There are lots of examples of configuring rTorrent for 'common tasks', but nothing that I've been able to use to infer how to even check labels, never mind move completed torrents according to the labels...
Asmor
(153 rep)
May 1, 2014, 04:22 AM
• Last activity: Mar 16, 2023, 02:24 AM
6
votes
2
answers
15693
views
How to block bittorent upload completely?
I'm running [Vuze][1] torrent client on Linux Mint and I am looking for a way to block upload completely. *** I am willing to change [Vuze][1] for something else if [Vuze][1] is not capable of achieving this goal. *** [Vuze][1] is only able to limit the upload to 5 Kbps, which is not 0! Another thin...
I'm running Vuze torrent client on Linux Mint and I am looking for a way to block upload completely.
***
I am willing to change Vuze for something else if Vuze is not capable of achieving this goal.
***
Vuze is only able to limit the upload to 5 Kbps, which is not 0!
Another thing I would like to have, as I upload large amounts of legal Linux ISO torrents, is a way to easily switch between Enable upload and Disable upload mode.
I can't seem to find any suitable plugin for Vuze. Something of this sort exists. It is named Auto Stopper. But it stops the upload after a certain ratio, it cannot be adjusted under 1.0.
***
Rationale: I contribute to the network by uploading Linux ISOs. But movie uploads are prohibited in my country. And I won't risk prosecution. So:
- I cannot upload movies (but can download them legally).
- I contribute in other ways (uploading many Linux ISOs).
***
Is there a way to achieve my goal?
***
Update
-
I am aware the network needs seeders for the torrent network to function. This question is dated 2015. Many things changed, including the way I function in networking and systems.
- I don't use Vuze anymore. It's too heavy, among other things.
- I switched to self-compiled Transmission .
- I use a PIA VPN on my machine with port forwarding and split-tunneling.
Vlastimil Burián
(30505 rep)
Sep 7, 2015, 02:53 PM
• Last activity: Mar 8, 2023, 03:06 AM
8
votes
4
answers
4318
views
Is there a CLI tool to parse/read and show the metadata from a torrent file?
I downloaded a torrent file http://cdimage.debian.org/cdimage/stretch_di_rc1/amd64/bt-cd/debian-stretch-DI-rc1-amd64-netinst.iso.torrent Now I want to parse/read it so that I can find out things like - a. Which software was used to create the torrent file ? b. The size of the iso image, the size and...
I downloaded a torrent file http://cdimage.debian.org/cdimage/stretch_di_rc1/amd64/bt-cd/debian-stretch-DI-rc1-amd64-netinst.iso.torrent
Now I want to parse/read it so that I can find out things like -
a. Which software was used to create the torrent file ?
b. The size of the iso image, the size and number of pieces
c. Number of trackers which the iso image.
All of which is meta-data.
I guess I'm looking for what mediainfo is for a media file -
[$] mediainfo Big_Buck_Bunny_small.ogv
General
ID : 30719 (0x77FF)
Complete name : Big_Buck_Bunny_small.ogv
Format : Ogg
File size : 2.65 MiB
Duration : 1 min 19 s
Overall bit rate mode : Variable
Overall bit rate : 280 kb/s
Writing application : ffmpeg2theora-0.25
SOURCE_OSHASH : cc9e38e85baf7573
Video
ID : 20319 (0x4F5F)
Format : Theora
Duration : 1 min 19 s
Bit rate : 212 kb/s
Nominal bit rate : 238 kb/s
Width : 240 pixels
Height : 134 pixels
Display aspect ratio : 16:9
Frame rate : 24.000 FPS
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.275
Stream size : 2.01 MiB (76%)
Writing library : Xiph.Org libtheora 1.1 20090822 (Thusnelda)
Audio
ID : 13221 (0x33A5)
Format : Vorbis
Format settings, Floor : 1
Duration : 1 min 19 s
Bit rate mode : Variable
Bit rate : 48.0 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Compression mode : Lossy
Stream size : 465 KiB (17%)
Writing library : libVorbis 20090709 (UTC 2009-07-09)
Is there something similar ? I am looking for a CLI tool .
shirish
(12954 rep)
Jan 31, 2017, 09:32 PM
• Last activity: Feb 23, 2023, 01:49 PM
0
votes
1
answers
428
views
How to use the command line to get a list of peers from a BitTorrent tracker
Given that I have the infohash of a torrent and the URL of a BitTorrent tracker (e.g. `udp://tracker.example.com/announce`), how do I use the command line to get all the IP addresses of peers that the tracker knows about? I am using Ubuntu 20.04.
Given that I have the infohash of a torrent and the URL of a BitTorrent tracker (e.g.
udp://tracker.example.com/announce
), how do I use the command line to get all the IP addresses of peers that the tracker knows about? I am using Ubuntu 20.04.
Flux
(3238 rep)
Jan 31, 2023, 10:38 AM
• Last activity: Jan 31, 2023, 12:36 PM
48
votes
8
answers
33020
views
Is there a tool to view a torrent file?
I am interested in rendering a torrent file into a readable form (to see what files does it reference, what tracker information does it contain etc.). What a tool can I use to do just this?
I am interested in rendering a torrent file into a readable form (to see what files does it reference, what tracker information does it contain etc.). What a tool can I use to do just this?
Ivan
(18358 rep)
Feb 12, 2012, 07:59 PM
• Last activity: Jan 15, 2023, 04:02 AM
1
votes
0
answers
134
views
How to move the torrent data around on a per-tracker basis?
Note that I'm looking for a fully **client-agnostic** method for managing torrent data — I don't want to be tied to a specific program and I'm confident that the task can be achieved with general Unix tools. To illustrate, I've loads of completed torrents from [archive.org][1] and [Kiwix][2] and wou...
Note that I'm looking for a fully **client-agnostic** method for managing torrent data — I don't want to be tied to a specific program and I'm confident that the task can be achieved with general Unix tools.
To illustrate, I've loads of completed torrents from archive.org and Kiwix and would for organization purposes benefit if the data was copied (or rather, symlinked) to dedicated directories in (e.g.)
~/torrents
, from the client's download folder:
/home/user/torrents/
├── archive.org
└── kiwix
A torrent file contains the torrents directory structure and the trackers used (if any). The .torrent files can be inspected with transmission-show
for instance.
In essence:
1. read the torrent files stored in the client's session directory (~/.config/transmission-daemon/
for transmission)
1. identify where each torrent's data is stored
1. copy or symlink the data to a tracker-specific directory (see the output of the tree
command above) from the torrent client's download folder (usually ~/Downloads
).
user598527
(735 rep)
Dec 6, 2022, 01:46 PM
0
votes
1
answers
114
views
Improving Bash service to start/stop torrents by monitoring public IP
I am looking for feedback on my solution to monitor my public ip for torrenting. The public IP is checked against icanhazip. If the vpn is not active, pause all torrents. If vpn is active, then a check for any torrents that are downloading is made. If at least one is downloading then a all are start...
I am looking for feedback on my solution to monitor my public ip for torrenting.
The public IP is checked against icanhazip. If the vpn is not active, pause all torrents. If vpn is active, then a check for any torrents that are downloading is made. If at least one is downloading then a all are started/queued, otherwise nothing is done because all torrents are paused.
#!/bin/bash
#Torrent/VPN Watch Service
while :
do
ip=$(curl -s icanhazip.com)
pchk=$(transmission-remote -tall -i | grep -a State | grep -ao Down | head -1)
if [ "$ip" = xxx.xxx.xxx.xxx ] ; then
date
echo "WARNING! The Current IP is: $ip"
echo "Torrents are being stopped!"
echo "Openvpn is being restarted!"
echo
sleep 5
/usr/bin/transmission-remote -tall --stop > /dev/null 2>&1
pkill -9 screen
screen -wipe > /dev/null 2>&1
pkill -9 openvpn
screen -dmS openvpn /usr/sbin/openvpn /usr/local/sbin/tvw/file.ovpn
fi
if [ "$pchk" = "Down" ] ; then
date
echo "The Current IP is: $ip"
echo "Torrents are active!"
echo
sleep 5
/usr/bin/transmission-remote -tall --start > /dev/null 2>&1
else
date
echo "Current IP: $ip"
echo "All torrents are paused."
echo
sleep 5
fi
done
exit
Cody Millard
(11 rep)
Oct 27, 2022, 02:16 AM
• Last activity: Oct 28, 2022, 09:59 PM
1
votes
1
answers
75
views
Is it possible to use the magnet uri scheme in PKGBUILDs?
Is it possible to use resources exchanged with the BitTorrent protocol in `pacman`'s `PKGBUILD`s?
Is it possible to use resources exchanged with the BitTorrent protocol in
pacman
's PKGBUILD
s?
Scrooge McDuck
(1102 rep)
Jun 1, 2022, 02:53 PM
• Last activity: Jul 16, 2022, 11:26 AM
0
votes
1
answers
25
views
BitTorrent etiquette with multiple nodes
I have two BitTorrent nodes running, one of which is on a limited data connection. I know you're supposed to leave the node running long enough for it to upload as much as it has downloaded, but is it okay to close the one on the limited connection early if I leave the unlimited one running?
I have two BitTorrent nodes running, one of which is on a limited data connection. I know you're supposed to leave the node running long enough for it to upload as much as it has downloaded, but is it okay to close the one on the limited connection early if I leave the unlimited one running?
Someone
(105 rep)
Jul 15, 2022, 08:49 PM
• Last activity: Jul 15, 2022, 09:33 PM
3
votes
1
answers
254
views
Chrome opens a second Transmission window with magnet links. How does it check if there is a transmission open or not?
The magnet link is correctly set with `xdg-mime` to open in `transmission`, and also in `.local/share/applications/mimeapps.list`. If `transmission` is NOT running, everything works as expected (click a magnet link or torrent file, and it opens). If `transmission` is running, clicking on a magnet li...
The magnet link is correctly set with
xdg-mime
to open in transmission
, and also in .local/share/applications/mimeapps.list
.
If transmission
is NOT running, everything works as expected (click a magnet link or torrent file, and it opens).
If transmission
is running, clicking on a magnet link in chrome will open a second transmission window.
This does not occur neither in firefox nor with the command xdg-open "magnet-link"
. The problems seems to be only in chrome.
Tech specs:
Debian buster with 4.19.0-2-amd64, fully upgraded.
transmission-gtk 2.94 (d8e60ee44f)
google chrome Version 72.0.3626.81 (Official Build) (64-bit)
xdg-open 1.1.3
awesome WM v4.3
edit: Checking chrome's log, I can see this related line
[21407:21407:0207/152959.142127:VERBOSE1:navigator_impl.cc(111)] Failed Provisional Load: magnet:?xt=urn:btih:, error_code: -3, error_description: The webpage at might be temporarily down or it may have moved permanently to a new web address., showing_repost_interstitial: 0, frame_id: 4
Orfeas0
(33 rep)
Feb 7, 2019, 12:18 PM
• Last activity: Jul 8, 2022, 06:44 AM
1
votes
0
answers
441
views
Vuze not starting?
root@debian:/home/love# vuze Starting Azureus... Suitable java version found [java = java 1.7.0_111] Configuring environment... Java exec found in PATH. Verifying... Error: Could not find or load main class org.gudy.azureus2.platform.unix.ScriptBeforeStartup Loading Azureus: java -Xmx256m -cp "./*.j...
root@debian:/home/love# vuze
Starting Azureus...
Suitable java version found [java = java 1.7.0_111]
Configuring environment...
Java exec found in PATH. Verifying...
Error: Could not find or load main class org.gudy.azureus2.platform.unix.ScriptBeforeStartup
Loading Azureus:
java -Xmx256m -cp "./*.jar" -Djava.library.path="/usr/bin" -Dazureus.install.path="/usr/bin" -Dazureus.script="/usr/bin/vuze" -Dazureus.script.version=6 org.gudy.azureus2.ui.swt.Main
Error: Could not find or load main class org.gudy.azureus2.ui.swt.Main
Exit from Azureus complete
Error: Could not find or load main class org.gudy.azureus2.platform.unix.ScriptAfterShutdown
Azureus TERMINATED.
Following steps were taken to install vuze:
$ wget http://cf1.vuze.com/files/VuzeInstaller.tar.bz2
$ tar -xjvf VuzeInstaller.tar.bz2
$ sudo rm -rf /opt/vuze*
$ sudo mv vuze /opt/vuze
$ sudo ln -sf /opt/vuze/vuze /usr/bin/vuze
Love Grover
(401 rep)
Jan 9, 2017, 08:24 AM
• Last activity: Jul 6, 2022, 01:28 AM
0
votes
0
answers
413
views
How do transmission-cli clients punch through NAT?
Trying to figure out how to configure nftables on self-hosted tracker (running [bittorrent-tracker](https://github.com/webtorrent/bittorrent-tracker)) and transmission-cli clients.
Trying to figure out how to configure nftables on self-hosted tracker (running [bittorrent-tracker](https://github.com/webtorrent/bittorrent-tracker)) and transmission-cli clients.
sunknudsen
(327 rep)
Feb 23, 2022, 05:05 PM
1
votes
1
answers
1593
views
How to install Vuze torrent client from the official website on Linux?
After reading the [installation steps of Vuze from the official website on Linux][1], I need to install it properly, as the instructions are rather short and incomplete. The particular OS in question is Linux Mint 18.3, but this should be a generic question covering most of Linuxes. [1]: https://wik...
After reading the installation steps of Vuze from the official website on Linux , I need to install it properly, as the instructions are rather short and incomplete.
The particular OS in question is Linux Mint 18.3, but this should be a generic question covering most of Linuxes.
Vlastimil Burián
(30505 rep)
Dec 15, 2017, 11:07 AM
• Last activity: Feb 21, 2022, 02:56 AM
Showing page 1 of 20 total questions