Command to move subtitles

If you run qBittorrent in / with Docker.
Post Reply
DrSeussFreak

Command to move subtitles

Post by DrSeussFreak »

I want to execute the following command

Code: Select all

find . -mindepth 2 -type f -iname '*.srt' -exec sh -c 'mv -i "$1" "${1%/*/*}"' sh {} \;
once a download finishes, so the subtitles stores in the "/downloads/movies/Subs/" directory are moved to the "/downloads/movies/" directory for import by radarr.

I know where I need to place the line of code, but I am not sure how to configure it to be ran in the recently downloaded files directory. I tried

Code: Select all

find %R -mindepth 2 -type f -iname '*.srt' -exec sh -c 'mv -i "$1" "${1%/*/*}"' sh {} \;
, but this did not work. Was hoping someone may have an idea on how to do this.
DrSeussFreak

Re: Command to move subtitles

Post by DrSeussFreak »

My directory structure is as follows

/dl/done/1/name.1080p.year/Subs
/dl/script/script_name.sh

I changed my script to the following

Code: Select all

find /dl/done -mindepth 4 -type f -iname '*.srt' -exec sh -c 'mv -i "$1" "${1%/*/*}"' sh {} \;
and now, everything is working as expected
Post Reply