Custom script after download?

I’m running sonarr on ubuntu 16.10 and want to run an .sh script after an episode gets downloaded. So far it doesn’t seem to do anything. It’s just a 1 line command to upload to amazon cloud. Running the same script through terminal manually works fine.

What do the ((debug logs)) show?

I was missing the #!/bin/sh but now it seems it tries to run it and I get this.

uploadTV.sh	2016/10/26 02:39:57 Failed to create file system for "ACD:/Plex/5wzUXjSOtie40xc-LRMP3bML": didn't find section in config file	6:39pm
uploadTV.sh	2016/10/26 02:39:57 Failed to load config file ".rclone.conf" - using defaults: open .rclone.conf: no such file or directory	6:39pm
uploadTV.sh	2016/10/26 02:39:57 Error was: user: Current not implemented on linux/amd64	6:39pm
uploadTV.sh	2016/10/26 02:39:57 Use -config flag to workaround.	6:39pm
uploadTV.sh	2016/10/26 02:39:57 Defaulting to storing config in current directory.	6:39pm

this ismy script

#!/bin/sh
echo "Uploading to ACD"

/usr/local/bin/acdcli sync
/usr/sbin/rclone move /home/plex/.local/5wzUXjSOtie40xc-LRMP3bML ACD:/Plex/5wzUXjSOtie40xc-LRMP3bML

/usr/local/bin/acdcli sync

exit

That looks like a problem with your script since Sonarr is executing it.

After trying different things I noticed this. If I start sonarr manually through the terminal the script works perfect. But if sonarr is running from boot after being started by upstart it give me the error above. Here is my upstart script which should be running as my plex user which who owns the folder and the script itself.

author "Simon Tallmyr - Nosscire"
description "Upstart Script to run Sonarr as a service on Ubuntu/Debian based systems, as well as others"

#Set username for the process. Should probably be what you use for logging in
setuid plex

env DIR=/opt/NzbDrone
#This is the install directory. If you installed using a deb package or the Sonarr Repository you do not need to change this

setgid plex
start on runlevel [2345]
stop on runlevel [016]

respawn

exec mono --debug $DIR/NzbDrone.exe

Sounds like the plex user doesn’t have access to the appropriate config files it needs (maybe because they are under your account?). Hopefully someone has some insight on this, but you may have more luck on another forum.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.