Discussion:
[Libtorrent-devel] rTorrent don't delete the data files when removing incomplete downloads
Taraszka Krzysztof
2008-10-19 09:34:49 UTC
Permalink
rTorrent don't delete the data files when removing incomplete downloads
from ncurses ui. (double ^d).
I try with:

# Enable removal for all downloads added from this watch directory.
schedule =
watch_directory,10,10,"load_start=~/Download/watch_stuff/*.torrent,d.set_custom2=1"

# Clear custom2 when download completes.
on_finished = set_done_var,d.set_custom2=

# Erase data files when a download is removed that still has custom2 set.
on_erase =
rm_files,"branch=d.get_custom2=,\"execute={rm,-rf,--,$d.get_base_path=}\""

Yes. it's works but only for torrents which was added to watch_stuff
directory. When i load torrent from ui, it don't remove incompete data.
The same problem exist when I remove torrents from nTorrent client (via
xmlrpc)

tested with 0.7.9 and 0.8.3.
--
Krzysztof Taraszka
GNUHosting.net
ul. Podlas 36d/9
41-703 Ruda Slaska
POLAND
NIP: 641-223-32-48
tel: +48 0 605 745 084
Josef Drexler
2008-10-19 10:10:01 UTC
Permalink
Post by Taraszka Krzysztof
rTorrent don't delete the data files when removing incomplete
downloads from ncurses ui.
I don't think that's quite right. The way you set it up, it will
delete data files when you remove the incomplete download with the
ncurses ui, but NOT when you've added the download from it.
Post by Taraszka Krzysztof
schedule = watch_directory,10,10,"load_start=~/Download/watch_stuff/
*.torrent,d.set_custom2=1"
on_finished = set_done_var,d.set_custom2=
on_erase = rm_files,"branch=d.get_custom2=,\"execute={rm,-rf,--,
$d.get_base_path=}\""
Yes. it's works but only for torrents which was added to
watch_stuff directory. When i load torrent from ui, it don't remove
incompete data. The same problem exist when I remove torrents from
nTorrent client (via xmlrpc)
That's because you've set it up that way. When added from the watch
directory, the downloads "custom2" is set. It's cleared when the
download finishes. When you remove the download and it's still set,
the data files will be deleted.

But when you add it from the UI, custom2 won't be set. Unless you set
it manually afterwards with Ctrl-X d.set_custom2=1 then it should
work as you want.
--
Josef Drexler
***@ttdpatch.net
Taraszka Krzysztof
2008-10-19 10:56:12 UTC
Permalink
Post by Josef Drexler
Post by Taraszka Krzysztof
rTorrent don't delete the data files when removing incomplete
downloads from ncurses ui.
I don't think that's quite right. The way you set it up, it will
delete data files when you remove the incomplete download with the
ncurses ui, but NOT when you've added the download from it.
Post by Taraszka Krzysztof
schedule =
watch_directory,10,10,"load_start=~/Download/watch_stuff/*.torrent,d.set_custom2=1"
on_finished = set_done_var,d.set_custom2=
on_erase =
rm_files,"branch=d.get_custom2=,\"execute={rm,-rf,--,$d.get_base_path=}\""
Yes. it's works but only for torrents which was added to watch_stuff
directory. When i load torrent from ui, it don't remove incompete
data. The same problem exist when I remove torrents from nTorrent
client (via xmlrpc)
That's because you've set it up that way. When added from the watch
directory, the downloads "custom2" is set. It's cleared when the
download finishes. When you remove the download and it's still set,
the data files will be deleted.
But when you add it from the UI, custom2 won't be set. Unless you set
it manually afterwards with Ctrl-X d.set_custom2=1 then it should work
as you want.
Ok, i will try this solution.

It should not be done automatically ? It will be facilitate for newbies
who don't care of incomplete downloads or just forget to delete it manually.

I have:

rtorrent/downloaded - there are data is moving when finished downloads
(and ofcourse data is seeding from this directory)
rtorrent/downloading - incomplete downloads directory
rtorrent/session - session directory
rtorrent/watch - watching directory for new data.
--
Krzysztof Taraszka
GNUHosting.net
ul. Podlas 36d/9
41-703 Ruda Slaska
POLAND
NIP: 641-223-32-48
tel: +48 0 605 745 084
Josef Drexler
2008-10-19 23:07:55 UTC
Permalink
Post by Taraszka Krzysztof
Post by Josef Drexler
That's because you've set it up that way. When added from the
watch directory, the downloads "custom2" is set. It's cleared when
the download finishes. When you remove the download and it's still
set, the data files will be deleted.
But when you add it from the UI, custom2 won't be set. Unless you
set it manually afterwards with Ctrl-X d.set_custom2=1 then it
should work as you want.
Ok, i will try this solution.
It should not be done automatically ? It will be facilitate for
newbies who don't care of incomplete downloads or just forget to
delete it manually.
Well, presumably there was a reason you've set it up this way (maybe
to allow people to keep incomplete downloads when they only wanted to
download a subset of the files, by clearing custom2 for the ones they
want to keep).

Otherwise, instead of checking d.get_custom2 in the erase handler, it
might work to check d.get_complete, and have rtorrent always delete
the data of incomplete downloads, with no way for the user to change
that (other than first copying the data elsewhere).
--
Josef Drexler
***@ttdpatch.net
Taraszka Krzysztof
2008-10-19 13:51:28 UTC
Permalink
Post by Josef Drexler
Post by Taraszka Krzysztof
rTorrent don't delete the data files when removing incomplete
downloads from ncurses ui.
I don't think that's quite right. The way you set it up, it will
delete data files when you remove the incomplete download with the
ncurses ui, but NOT when you've added the download from it.
Post by Taraszka Krzysztof
schedule =
watch_directory,10,10,"load_start=~/Download/watch_stuff/*.torrent,d.set_custom2=1"
on_finished = set_done_var,d.set_custom2=
on_erase =
rm_files,"branch=d.get_custom2=,\"execute={rm,-rf,--,$d.get_base_path=}\""
Yes. it's works but only for torrents which was added to watch_stuff
directory. When i load torrent from ui, it don't remove incompete
data. The same problem exist when I remove torrents from nTorrent
client (via xmlrpc)
That's because you've set it up that way. When added from the watch
directory, the downloads "custom2" is set. It's cleared when the
download finishes. When you remove the download and it's still set,
the data files will be deleted.
But when you add it from the UI, custom2 won't be set. Unless you set
it manually afterwards with Ctrl-X d.set_custom2=1 then it should work
as you want.
Hmm. could it work with session directory to ? I mean, when rtorrent
deleting files from session directory (~/rtorrent/session), he could
deleting incomplete downloads from ~/rtorrent/downloading too.
--
Krzysztof Taraszka
GNUHosting.net
ul. Podlas 36d/9
41-703 Ruda Slaska
POLAND
NIP: 641-223-32-48
tel: +48 0 605 745 084
Loading...