Page 1 of 1
amc --def exec with groovy
Posted: 19 Aug 2017, 04:17
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""
Re: amc --def exec with groovy
Posted: 19 Aug 2017, 04:24
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
Re: amc --def exec with groovy
Posted: 19 Aug 2017, 04:38
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.
Re: amc --def exec with groovy
Posted: 19 Aug 2017, 04:48
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.

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.
