Filebot Script (Unraid) Folder removal

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
tronder
Posts: 13
Joined: 03 Jun 2024, 22:45

Filebot Script (Unraid) Folder removal

Post by tronder »

Hi All,

Trying to get Filebot script to remove empty folders running in unraid. The script works sometimes...

When I check the folder, it's actually empty. I'm not sure if I'm doing the move or the deleting in unraid is taking a little longer which causes filebot to mark the folder as (not empty).

Any ideas?

Code: Select all

Clean clutter files and empty folders
Delete /downloads/Napoleon.2023.Directors.Cut.2160p.WEB-DL.DV.HDR10.PLUS.ENG.LATINO.DDP5.1.Atmos.H265.MKV-BEN.THE.MEN/Downloaded From glodls.to.txt
Delete /downloads/Napoleon.2023.Directors.Cut.2160p.WEB-DL.DV.HDR10.PLUS.ENG.LATINO.DDP5.1.Atmos.H265.MKV-BEN.THE.MEN/Downloaded From The Pirate Bay.txt
Delete /downloads/Napoleon.2023.Directors.Cut.2160p.WEB-DL.DV.HDR10.PLUS.ENG.LATINO.DDP5.1.Atmos.H265.MKV-BEN.THE.MEN/Downloaded From torrentgalaxy.to.txt
Keep /downloads/Napoleon.2023.Directors.Cut.2160p.WEB-DL.DV.HDR10.PLUS.ENG.LATINO.DDP5.1.Atmos.H265.MKV-BEN.THE.MEN (not empty)
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 23395
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Script (Unraid) Folder removal

Post by rednoah »

:?: What does ls -la say?

Shell: Select all

ls -la /downloads/Napoleon.2023.Directors.Cut.2160p.WEB-DL.DV.HDR10.PLUS.ENG.LATINO.DDP5.1.Atmos.H265.MKV-BEN.THE.MEN

:idea: You likely have a hidden file / folder that makes the parent folder appear empty but not actually be empty.


:!: If you are using docker then you need to adjust the file path above to something that makes sense on the host.
:idea: Please read the FAQ and How to Request Help.
tronder
Posts: 13
Joined: 03 Jun 2024, 22:45

Re: Filebot Script (Unraid) Folder removal

Post by tronder »

Console Output: Select all

root@4c476f54a9b6:/# ls -la /downloads/Napoleon.2023.Directors.Cut.2160p.WEB-DL.DV.HDR10.PLUS.ENG.LATINO.DDP5.1.Atmos.H265.MKV-BEN.THE.MEN
total 50
drwxr-xr-x 1 abc abc 2 Sep  3 23:05 .
drwxrwxrwx 1 abc abc 6 Sep  3 21:37 ..
root@4c476f54a9b6:/# 
Can't see any hidden folders

Yes it's built into qbittorent in a docker. If i Rerun the command to clean clutter it deletes the file but I think it might have something to do with unraid and how long it takes to delete or move a file
User avatar
rednoah
The Source
Posts: 23395
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Script (Unraid) Folder removal

Post by rednoah »

tronder wrote: 04 Sep 2024, 00:40 If i Rerun the command to clean clutter it deletes the file
If a rerun then deletes the folder then there was a temporary file there at the time.

tronder wrote: 04 Sep 2024, 00:40 unraid and how long it takes to delete or move a file
Delete will always be fairly instant. Move will take a long time since your docker mounts are bad. Please read Notes on --action MOVE and --action HARDLINK for details.
:idea: Please read the FAQ and How to Request Help.
tronder
Posts: 13
Joined: 03 Jun 2024, 22:45

Re: Filebot Script (Unraid) Folder removal

Post by tronder »

rednoah wrote: 04 Sep 2024, 03:46
tronder wrote: 04 Sep 2024, 00:40 If i Rerun the command to clean clutter it deletes the file
If a rerun then deletes the folder then there was a temporary file there at the time.
Is there a way to fix this issue causing it to say not empty?
User avatar
rednoah
The Source
Posts: 23395
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Script (Unraid) Folder removal

Post by rednoah »

:arrow: You can write your own delete scripts that deletes files indiscriminately. Be careful with that though.

:?: The other thing of interessant would be why the folder is "not empty" at the time.

:?: What does the complete console output say? The beginning of the console output will mirror all the input file paths so that you can see that was there later.
:idea: Please read the FAQ and How to Request Help.
tronder
Posts: 13
Joined: 03 Jun 2024, 22:45

Re: Filebot Script (Unraid) Folder removal

Post by tronder »

rednoah wrote: 04 Sep 2024, 07:33 :?: The other thing of interessant would be why the folder is "not empty" at the time.
not sure, because the folder is empty...

:?: What does the complete console output say? The beginning of the console output will mirror all the input file paths so that you can see that was there later.

Code: Select all

[PSA] Important Discussion of Changes effective as of 28 Apr 2023:
https://www.filebot.net/forums/viewtopic.php?t=13406

Parameter: ut_kind = multi
Parameter: excludeList = /data/filebot/amc-exlude-list.txt
Parameter: clean = y
Parameter: unsorted = y
Parameter: music = y
Parameter: musicFormat = /media/{plex}
Parameter: artwork = /media/y
Parameter: movieFormat = /media/{plex}
Parameter: seriesFormat = /media/{plex}
Parameter: animeFormat = /media/animes/{n}/{e.pad(3)} - {t}
Parameter: ut_dir = /downloads/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos
Parameter: ut_title = Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos
Parameter: ut_label = 
Use excludes: /data/filebot/amc-exlude-list.txt (0)
Input: /downloads/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos.mkv
Group files by movie or series
Group: {Movie=Ratatouille (2007)} => [Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos.mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context [/downloads/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos.mkv]
[MOVE] from [/downloads/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos.mkv] to [/media/Movies/Ratatouille (2007)/Ratatouille (2007).mkv]
Processed 1 file
Clean clutter files and empty folders
Delete /downloads/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos/[TGx]Downloaded from torrentgalaxy.to .txt
Delete /downloads/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos/user.txt
Keep /downloads/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos (not empty)
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 23395
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Script (Unraid) Folder removal

Post by rednoah »

Unfortunately, the log doesn't print any Input: lines for the extra file that is there:

Code: Select all

Input: /downloads/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos/Ratatouille (2007) [2160p] UHD [BR] HDR AV1 TrueHD.7.1+Atmos.mkv

:idea: You could add your own logging with a find command before the filebot call to see the files that are there at the time. Other than that, not much you can do since we don't know what's going on and have no way of finding out. We'll look into adding more verbose console output to the cleaner script so that we can see which file(s) make the folder not empty at the time after the fact.



EDIT:

You can use -script dev:amc instead of -script fn:amc to run tests with the latest changes that add additional logging.
:idea: Please read the FAQ and How to Request Help.
Post Reply