Delete files but let empty directonies !

Linux specific questions, problems.
Post Reply
vincen
Newbie
Newbie
Posts: 4
Joined: Thu Jul 25, 2024 7:56 am

Delete files but let empty directonies !

Post by vincen »

Hi

I'm using qBittorrent 4.5.2 on Linux Debian 12.
Everything works very well out of a little detail. When I decide to remove a torrent in the web GUI and select also to delete files it deletes all files regarding that torrent but not the directory itself which is quite annoying. Any ideas why ?

Thanks

Vincèn
User avatar
Peter
Administrator
Administrator
Posts: 3044
Joined: Wed Jul 07, 2010 6:14 pm

Re: Delete files but let empty directonies !

Post by Peter »

Permission issues I'd say/think?
vincen
Newbie
Newbie
Posts: 4
Joined: Thu Jul 25, 2024 7:56 am

Re: Delete files but let empty directonies !

Post by vincen »

Peter wrote:
> Permission issues I'd say/think?

Would have been the easy solution but it's not as qBittorrent runs as same user as directory where torrents are stored so there should not be any problem of rights ;)
User avatar
Peter
Administrator
Administrator
Posts: 3044
Joined: Wed Jul 07, 2010 6:14 pm

Re: Delete files but let empty directonies !

Post by Peter »

Anything in the log then? It's called "Execution Log" in qBittorrent.
vincen
Newbie
Newbie
Posts: 4
Joined: Thu Jul 25, 2024 7:56 am

Re: Delete files but let empty directonies !

Post by vincen »

Peter wrote:
> Anything in the log then? It's called "Execution Log" in
> qBittorrent.

I'll have to investigate as it doesn't log in the syslog and I struggle to find qBittorrent settings life itself also :( Used the Swizzin system to install the seedbox but it lacks quite some documentation on how it setups everything :(
User avatar
Peter
Administrator
Administrator
Posts: 3044
Joined: Wed Jul 07, 2010 6:14 pm

Re: Delete files but let empty directonies !

Post by Peter »

Why not just run qbittorrent-nox-static?
vincen
Newbie
Newbie
Posts: 4
Joined: Thu Jul 25, 2024 7:56 am

Re: Delete files but let empty directonies !

Post by vincen »

Peter wrote: Tue Jul 30, 2024 6:03 pm Why not just run qbittorrent-nox-static?
what's the difference ? with qbittorrent-static ?
ticedoff8
Member
Member
Posts: 21
Joined: Sat Jul 20, 2024 1:16 am

Re: Delete files but let empty directonies !

Post by ticedoff8 »

In my Windows system, that's a symptom of a rogue file being created in the directory before the torrent finished downloading (or deleted) or the folder is still open in another app (like File Explorer or a CMD window) and locked.
The torrent content may get moved or deleted, but the temp torrent folder gets left behind because it's locked or there is a rogue file left.

If you are using a NAS for the /download directory, you may want to check to see if the NAS export has oplock enabled for the export or if there is another application (like a Windows PC) that may have the folders open.

Also look for .files. They will not show up with a simple 'ls' command. But do a 'ls -la' and there may see a .file.
Picasa was notorious for scanning new folders and leaving a .picasa file in each folder.
AnLuoRidge
Newbie
Newbie
Posts: 1
Joined: Mon Dec 23, 2024 10:58 am

Re: Delete files but let empty directonies !

Post by AnLuoRidge »

I have the same problem. The logs say

Code: Select all

Removed torrent but failed to delete its content and/or partfile. Error: "Directory not empty"
Upon checking
- There's no hidden files before or after the deletion.
- I haven't added any additional files into the folder.
- All the files in the torrent is 100% downloaded.
- I never opened this folder in OS.
- I opt in.!qB as the extension name of incomplete files but by the time I deleted the torrent there're not .!qB files

qBittorrent version 4.6.2, running inside docker container on DSM 7.2

btw I found a similar discussion on GitHub.

UPDATE 2024-12-23
I finally found these’s a hidden @eaDir in the folder. It’s not visible in macOS (even tho I revealed all the hidden files) because DSM hides it from SMB/AFP connection.

UPDATE 2024-12-24
I found qbit_manage can delete these orphaned directories automatically.

Code: Select all

orphaned:
  # Orphaned files are those in the root_dir download directory that are not referenced by any active torrents.
  # Will automatically remove all files and folders in orphaned data after x days. (Checks every script run)
  # If this variable is not defined it, the orphaned data will never be emptied.
  # WARNING: Setting this variable to 0 will delete all files immediately upon script run!
  empty_after_x_days: 60
  # File patterns that will not be considered orphaned files. Handy for generated files that aren't part of the torrent but belong with the torrent's files
  exclude_patterns:
    - "**/.DS_Store"
    - "**/Thumbs.db"
    - "**/@eaDir"
    - "/data/torrents/temp/**"
    - "**/*.!qB"
    - "**/*_unpackerred"
Post Reply