Move to a different folder if name includes specific string

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
pjburnhill
Posts: 18
Joined: 15 Mar 2017, 20:02

Move to a different folder if name includes specific string

Post by pjburnhill »

Sorry if this is a daft question, but how would I move specific media to another folder (i.e. not /Movies) if the name includes a specific string (like '.KORSUB.', '.HC.' or '.HARDCODED.')?

Currently using this:

Code: Select all

/usr/bin/filebot -script fn:amc --output "/GD/Media/Plex" --action move -non-strict "/GD/Media/Plex/Incoming/Film" --def @/root/.filebot/args.txt -no-xattr --def subtitles=en --def pushbullet= --def storeReport=y --def clean=y --def "ut_label=Movie" --def unsorted=y --log-file amc_movies.log --conflict override
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move to a different folder if name includes specific string

Post by rednoah »

1
Destination path is up to your format:

Code: Select all

f =~ /KORSUB|HC|HARDCODED/ ? 'Not Movies' : 'Movies'
@see viewtopic.php?f=5&t=4191


2.
You may need to read up on the --def excludeList option.
:idea: Please read the FAQ and How to Request Help.
pjburnhill
Posts: 18
Joined: 15 Mar 2017, 20:02

Re: Move to a different folder if name includes specific string

Post by pjburnhill »

rednoah wrote:1
Destination path is up to your format:

Code: Select all

f =~ /KORSUB|HC|HARDCODED/ ? 'Not Movies' : 'Movies'
@see viewtopic.php?f=5&t=4191

2.
You may need to read up on the --def excludeList option.
Thanks! Was totally unaware that conditional structures were supported.

2. Did you mean read up on --def excludeList as it's not included in my command? I don't include it as I only process finished downloads and move them to appropriate folders, never processing same files twice.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move to a different folder if name includes specific string

Post by rednoah »

2.
What happens if a file cannot be identified or just can't be moved to the destination folder for some reason?
:idea: Please read the FAQ and How to Request Help.
pjburnhill
Posts: 18
Joined: 15 Mar 2017, 20:02

Re: Move to a different folder if name includes specific string

Post by pjburnhill »

rednoah wrote:2.
What happens if a file cannot be identified or just can't be moved to the destination folder for some reason?
I am using the --def unsorted=y and I haven't had an issue with not being able to be moved into the Films folder. The incoming folder and the Films folder are on the same drive with unlimited storage, so I assume that shouldn't really happen?

But I guess there's no harm in using --def excludeList I guess.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move to a different folder if name includes specific string

Post by rednoah »

With unsorted it's probably fine. But there's always unexpected corner cases. That's why I'd always recommend adding excludeList regardless of what you're doing if your input folder is constant.
:idea: Please read the FAQ and How to Request Help.
Post Reply