SOLVED Why does "iocage exec" keep failing, telling me my script doesn't exist?

Cheese_Echidna

Dabbler
Joined
Jan 16, 2022
Messages
13
Hi, I've been using TrueNAS for nearly a year now and I love it.
I have finally gotten around to automating the updating of my Plex Media Server with a cronjob, only one problem, for some reason my "iocage exec" keeps failing.
I run iocage exec Plex ./PMS_Updater.sh -a (From the shell) and receive back:
Code:
jexec: execvp: ./PMS_Updater.sh: No such file or directory
Command ./PMS_Updater.sh -a failed!

This could be confused as the file really not existing; however, if I run:
Code:
iocage console Plex
./PMS_Updater.sh

Then the script runs. Any idea why, or how to get around this?
(All of my software is up to date)
 
Joined
Oct 22, 2019
Messages
3,641
iocage exec Plex ./PMS_Updater.sh -a

Try this instead:
iocage exec Plex /root/PMS_Updater.sh -a

When you console into a jail, by default you enter the directory /root/, which is why using ./ works. However, using "iocage exec" from the outside requires the absolute path.
 
Top