AMC working from Transmission, not from Hazel

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

AMC working from Transmission, not from Hazel

Post by mikejandreau »

I'm trying to move from Transmission running Filebot on torrent completion to running it in Hazel when a finished torrent shows up in the directory.

The Transmission post processing works great, but when trying to run the Hazel version, I get an error. The script output from Hazel is:

Code: Select all

2022-04-20 12:32:41.321 hazelworker[38349] DEBUG: == script output ==
+ /opt/homebrew/bin/filebot -script fn:amc '/Volumes/Iron Storage/Filebot/Moon.Knight.S01E03.Moon.Knight.1080p.DSNP.WEBRip.DDP5.1.Atmos.x264-CM[rartv]/Moon.Knight.S01E03.Moon.Knight.1080p.DSNP.WEB-DL.DDP5.1.Atmos.H.264-CM.mkv' --output '/Volumes/Super Storage/Video/To Be Processed' --conflict skip -non-strict --log-file /Users/mj/Desktop/amc.log --action TEST --def excludeList=.excludes unsorted=y music=y artwork=n
AppData folder does not exist and could not be created: /.filebot
An unexpected error occurred during startup: /.filebot: Read-only file system
java.nio.file.FileSystemException: /.filebot: Read-only file system
	at net.filebot.ApplicationFolder.mkdir(Unknown Source)
	at net.filebot.Main.main(Unknown Source)


== End script output ==
I'm not sure why, when run from Hazel, it doesn't recognize that .filebot exists, when the AMC script from Transmission has no problem running.
User avatar
rednoah
The Source
Posts: 20927
Joined: 16 Nov 2011, 08:59

Re: AMC working from Transmission, not from Hazel

Post by rednoah »

Looks like $HOME is undefined. You may need to configure Hazel to preserve environment variables when running scripts, or explicitly set $HOME to your home folder before calling filebot.


:!: /.filebot as opposed to /Users/<username>/.filebot indeed cannot possibly work, because the file system root / is reserved for system files:

Code: Select all

AppData folder does not exist and could not be created: /.filebot
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: AMC working from Transmission, not from Hazel

Post by mikejandreau »

Is Filebot calling $HOME somewhere?

I don't have that in my amc.sh file:

Code: Select all

#!/bin/sh -xu
/opt/homebrew/bin/filebot -script fn:amc "[email protected]" --output "/Volumes/Super Storage/Video/To Be Processed" --conflict skip -non-strict --log-file "/Users/mj/Desktop/amc.log" --action TEST --def excludeList=".excludes" unsorted=y music=y artwork=n
Unless that's what "[email protected]" is calling?
User avatar
rednoah
The Source
Posts: 20927
Joined: 16 Nov 2011, 08:59

Re: AMC working from Transmission, not from Hazel

Post by rednoah »

mikejandreau wrote: 20 Apr 2022, 17:54 Is Filebot calling $HOME somewhere?
Yes, the filebot command assumes that $HOME is set to your user home folder:

Code: Select all

cat /opt/homebrew/bin/filebot


:idea: "[email protected]" passes along the argument list "$1" "$2" "$3" etc:
https://stackoverflow.com/a/9994328/1514467
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: AMC working from Transmission, not from Hazel

Post by mikejandreau »

Got it, thanks.

Will muck with it and see if I can get Hazel to recognize where the home directory is.
User avatar
rednoah
The Source
Posts: 20927
Joined: 16 Nov 2011, 08:59

Re: AMC working from Transmission, not from Hazel

Post by rednoah »

I'd fix it in my entry point script:

Code: Select all

#!/bin/sh -xu
export HOME="/Users/mj"
/opt/homebrew/bin/filebot ...
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: AMC working from Transmission, not from Hazel

Post by mikejandreau »

That did the trick. Thanks for all the help!
Post Reply