Clean up script moves files but leaves empty folders behind

Discussion of Transmission that doesn't fit in the other categories
Post Reply
serafin
Posts: 4
Joined: Mon Jun 02, 2014 2:43 am

Clean up script moves files but leaves empty folders behind

Post by serafin »

I'm trying to get the post-processing scripts (e.g. [1], [2]) to work to move downloaded torrents into a new directory. The downloaded torrents are typically directories with files in them. The script triggers and runs, and the files within those torrent directories are moved, but the parent directories are not deleted. I've tried

Code: Select all

transmission-remote --torrent $TORRENTID --move $MOVEDIR
transmission-remote --torrent $TORRENTID --remove-and-delete
as well as

Code: Select all

transmission-remote --torrent $TORRENTID --move $MOVEDIR
transmission-remote --torrent $TORRENTID --remove
Neither of which work. The symptom seems to be the same as described in viewtopic.php?f=2&p=53606, which looks similarly unresolved. Any suggestions on how to fix this?

SG

[1] https://gist.github.com/bulljit/791609
[2] http://www.ercoppa.org/BASH-Transmissio ... cation.htm
Astara
Posts: 50
Joined: Sun Apr 18, 2010 8:36 pm

Re: Clean up script moves files but leaves empty folders beh

Post by Astara »

Can you run your own script after the torrent is downloaded?

in that script, you can 'cd' to the download dir and use
a find command to get rid of empty dirs:

Code: Select all

find . -type d -empty -delete

serafin
Posts: 4
Joined: Mon Jun 02, 2014 2:43 am

Re: Clean up script moves files but leaves empty folders beh

Post by serafin »

Thanks @Astara -- yes I can run my own script. I'm just trying to figure out whether what I'm seeing (left over empty directories) is expected behavior from Transmission, or whether I might have something misconfigured.

SG
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Clean up script moves files but leaves empty folders beh

Post by rb07 »

serafin wrote:I'm just trying to figure out whether what I'm seeing (left over empty directories) is expected behavior from Transmission
No, but it happens if something extra was added to the directory... which is normal if you have (multi-media) "indexing" which creates Thumbs.db, @eaDir, or any other (probably invisible to regular browsing) file or directory.
Post Reply