amc --def exec with groovy

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
patrickacollier
Posts: 2
Joined: 19 Aug 2017, 03:23

amc --def exec with groovy

Post by patrickacollier »

Thanks rednoah for the hard work! I'm curious if i'm looking at this correctly. If I simple want to copy any files processed seperatly from the standard amc script would i do something like this?

Code: Select all

--def exec="copy "~/googledrive/Movies""
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc --def exec with groovy

Post by rednoah »

If you want to mirror files into a separate structure, then I'd use these commands:
viewtopic.php?f=4&t=4788


:!: copy suggests that you're using Windows. ~ suggestions you're using Unix. So this is gonna fail either way.


:!: You're using "..." incorrectly, which suggests you need to brush up on some command-line basics: viewtopic.php?f=4&t=1899
:idea: Please read the FAQ and How to Request Help.
patrickacollier
Posts: 2
Joined: 19 Aug 2017, 03:23

Re: amc --def exec with groovy

Post by patrickacollier »

Point taken. Snippet was copied from another topic (based on windows). I wasn't sure if copy was part of a groovy function. In the end I just need to copy any file that gets renamed/processed. The topic you shared is that hinting at running a separate file after the first or that those commands can be passed through exec? Applogies, I'm new to this project.
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc --def exec with groovy

Post by rednoah »

1.
--def exec is like running shell commands.

e.g. echo {n} will result in commands such as echo Avatar to be executed.

You can do cp commands, but that'll give you a flat file structure and it won't create folders as necessary. Try doing it manually from bash and you will find that it's not quite as straight-forward as it might seem at first. ;)


2.
The mirror examples are indeed showing how to mirror a master file structure to a different file structure using hardlinks using existing xattr metadata. It'll check all files, but since it'll only use local xattr metdata it'll be near instant.

:idea: Once you have a filebot-mirror script that you can call from bash, then you can also have filebot call it via --def exec. That makes things easy to test and maintain. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply