Page 1 of 1

automatically rename and movie folder and movie file on Unraid

Posted: 10 Mar 2026, 23:24
by CaptainKen
Using filebot v26.02.3 (2026-02-22) on unraid 7.2.3.

Container paths:
\downloads\torrents\filebot-in
\downloads\torrents\filebot-out

1) Attempting to get it to automatically rename movie folder and movie file inside of filebot-in/Movies and then move to filebot-out/Movies folder. It's renaming the folder and movie file as well as successfully moving them, however, it's deleting all files in the original folder, instead of moving all files (nfo, jpg's) into movie folder inside of filebot-out/Movies. So the newly renamed movie folder inside of filebot-out/Movies only has the movie file. Note, that I don't want the original folder and contents deleted.

Just before posting here, I discovered this old post on the topic. However, since it's 14-years old I'm lead to believe it's outdated, so I did not review or try it.
viewtopic.php?t=215

2) It is also not using a custom preset flagged as default. To set as default I opened the edit "Movies" preset I created, then opened the format editor and selected "use format".

MY ATTEMPTS:
I worked with Chatgpt for hours trying various code in "Automated Media Center: Custom Options:". Here are a few we tried:
--def movieFormat="{ny} ({y})/{ny} ({y})" --def clean=n --apply import
--def movieFormat="{ny} ({y})/{ny} ({y})" --def clean=n --def subtitles=en --def exts="srt|jpg|nfo"
--def movieFormat="{ny} ({y})/{ny} ({y})" --def clean=n --def subtitles=en --apply import
--def movieFormat="{ny} ({y})/{ny} ({y})" --def clean=n --def subtitles=en --def artwork=y --def exts="srt|jpg|nfo"

ChatGPT also provided various User Bash Scripts. Here's the last one, but no luck:

Code: Select all

#!/bin/bash
# ===============================================
# Auto-Process FileBot Script for Unraid (Docker)
# Works with jlesage/filebot container
# Moves .mkv, .srt, .jpg, movie.nfo
# ===============================================

# Name of your FileBot container
CONTAINER_NAME="filebot"

# Input / output folders (mapped inside container)
SRC="/mnt/user/downloads/torrents/filebot-in/Movies"
DEST="/mnt/user/downloads/torrents/filebot-out/Movies"

# Loop over each folder in the input directory
for folder in "$SRC"/*/; do
    [ -d "$folder" ] || continue  # skip non-folders

    # Run FileBot inside the container
    docker exec "$CONTAINER_NAME" filebot -rename "$folder" \
        --db TheMovieDB \
        --format "{ny} ({y})/{ny} ({y})" \
        --action move \
        --output "$DEST" \
        --def clean=n \
        --def subtitles=en \
        --def exts="mkv|jpg|srt|nfo" \
        --def artwork=y

    # Log success
    echo "$(date): Processed folder $folder" >> /mnt/user/downloads/torrents/filebot-log.txt
done

Re: automatically rename and movie folder and movie file on Unraid

Posted: 11 Mar 2026, 05:46
by rednoah
CaptainKen wrote: 10 Mar 2026, 23:24 Container paths:

Code: Select all

\downloads\torrents\filebot-in
\downloads\torrents\filebot-out
:!: If you're using docker then you need to make sure that you have a single volume mount that contains both input and output folder, especially if you plan on moving files. Notes on --action MOVE and --action HARDLINK
will explain the technical details.


CaptainKen wrote: 10 Mar 2026, 23:24 1) Attempting to get it to automatically rename movie folder and movie file inside of filebot-in/Movies and then move to filebot-out/Movies folder. It's renaming the folder and movie file as well as successfully moving them, however, it's deleting all files in the original folder, instead of moving all files (nfo, jpg's) into movie folder inside of filebot-out/Movies. So the newly renamed movie folder inside of filebot-out/Movies only has the movie file. Note, that I don't want the original folder and contents deleted.
:?: Please paste the console output so that we can see what your filebot command is doing. Using a --log file is strongly recommended, so that you can check what's going on after the fact if you're not using an interactive terminal running commands yourself.


CaptainKen wrote: 10 Mar 2026, 23:24 Just before posting here, I discovered this old post on the topic. However, since it's 14-years old I'm lead to believe it's outdated, so I did not review or try it.
viewtopic.php?t=215
:idea: The amc script manual is up-to-date and reading it from top to bottom is strongly recommended. Let me know if you have any questions on the content, especially if you find any thing that does not work as documented. Running the amc script manually - before setting up any kind of unattended automation - is always a good idea.