I have media files coming into a directory. This media files shall be renamed according the media type.
This works fine so far with below script (bash). Thanks to the file bot team for such a great tool! Amazing!
I'd like to enhance the script by the following logiv:
- delete the source directory, no matter whats in it. Which is easy possible with by rm -r $dir
- process the target directory any further
Questions:
- how do I know, when the source folder processing has been fully completed?
I could add rm -r $dir or clean=y (more or less solved as it is now).
- how do I get the path of the newly created destination folder?
There I would need the folder once, no matter how many files are in it.
From research I have learned, that a few people achieve this by using history.xml. I'd like to avoid this solution as it could lead to race conditions if the script is executed more than once in the same time. Which isn't vey much likely but it could happen.
Kind regards
n
Code: Select all
filebot.sh -script fn:amc --output "$otdir" --action copy --conflict override -non-strict \
--def movieFormat="$otdir/Kino/{ny}/{ny}{fn =~ /3D/ ? '.[3D]-[H-SBS]' : ''}.{lang =~ // ? 'NOLANG' : lang}" \
seriesFormat="$otdir/Serien/{n}/{fn}" animeFormat="$otdir/Anime/{n}/{fn}" musicFormat="$otdir/Audio/{n}/{fn}" \
--def clean=y unsorted=y music=y artwork=n \
"ut_label=None" "ut_state=128" "ut_title={n}" "ut_kind=multi" "ut_file=$file" "ut_dir=$dir"