Page 1 of 1
AMC workflow using "--def exec"
Posted: 20 Jun 2016, 03:55
by WeAreSolipsists
Hi,
I'm using AMC on completed torrents, with Transmission on OSX and the transmission-postprocess script. I'd like to add an external script executed using"--def exec", and I have a question about the order in which the script gets called.
Does AMC match/process every file from the torrent before starting to run the external script on the processed files? Or is the external script run on each file as they are matched/processed? And does AMC wait for the external script to complete before moving on? Or does it just run the external script multiple times simultaneously?
I'm wanting to re-encode certain TV shows using HandbrakeCLI after they are matched/processed using AMC. If I download a whole season at once, it would be nice to let AMC do it's thing before the re-encodes start.
Thanks.
Re: AMC workflow using "--def exec"
Posted: 20 Jun 2016, 04:47
by rednoah
Does AMC match/process every file from the torrent before starting to run the external script on the processed files?
Depends on your
--def exec template. It'll generate a command for each processed file, but each unique command will only be executed once.
e.g. one single call:
e.g. a single call for each file:
Or is the external script run on each file as they are matched/processed?
--def exec commands are called after everything has been processed successfully.
And does AMC wait for the external script to complete before moving on?
Yes, commands will be called in sequence.
Re: AMC workflow using "--def exec"
Posted: 20 Jun 2016, 05:29
by WeAreSolipsists
Excellent - thanks for the quick and clear response.
Re: AMC workflow using "--def exec"
Posted: 08 Sep 2016, 14:26
by hansooloo
Follow up question:
If I have multiple commands I want to run, can I use multiple "--def exec" options on the same filebot.sh command line?
e.g., do chmod, chown, an rsync, an rm, and then curl (to trigger Plex update of Movies section, don't want ALL).
Re: AMC workflow using "--def exec"
Posted: 08 Sep 2016, 14:38
by rednoah
Whatever you pass in will be run on the shell, so you can do multiple commands as usual:
Code: Select all
--def exec="echo A && echo B && echo C"
Though I'd recommend making your own shell script that does all your stuff and then call that.
Re: AMC workflow using "--def exec"
Posted: 03 Nov 2016, 00:53
by shinomory
Hi, I know you just stated that unique commands are executed only once each depending on your --def exec command, but I'm finding this to not be the case.
Here's the relevant input from the log, more or less:
Code: Select all
Parameter: ut_kind = multi
Parameter: ut_dir = /home/hd24/shinomory/files/data/TV/TV.Fake.TV.Season.S02
Parameter: artwork = false
Parameter: extractfolder = /home/hd24/shinomory/torrents/extracted
Parameter: skipExtract = y
Parameter: music = n
Parameter: exec =". ~/doit.sh"
and I see at the bottom:
Code: Select all
Processed 10 files
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Execute: . ~/doit.sh
Sure enough, the script gets called 10 times in a row. Is there something going on here I'm completely missing?
Re: AMC workflow using "--def exec"
Posted: 03 Nov 2016, 07:34
by rednoah
Thanks for the post! Before a real human comes by, please make sure your report has all the following points checked:
- What are you trying to do achieve? What's not working? What have you tried so far?
- Include screenshots, logs or filenames (i.e. demonstrate the issue)
- Include basic information (i.e. sysinfo output)

Please read
How to Request Help and
Fix Problems, Report Bugs, Get Features