Scheduling a script execution with cron in a jail on FreeNas

I have a jail on my FreeNAS server containing Plex, and I have at the root of this jail a script called PMS_Updater.sh which checks if a new version of Plex is available and install it if it is the case.

To run the script manually, I do: (jail ID 1 for plex in this case)

jexec 1 csh
./PMS_Updater.sh -vv -a

I want to have this script executed on a daily basis during the night. As I particularly don't like vi, I first changed the editor to nano. I did try with both vi and nano anyway.

setenv VISUAL nano

Then I edit the crontab:

crontab -e
0 4 * * * ./PMS_Updater -a

And save. The file saved is: /tmp/crontab.ZNYUiym7w9. Yesterday, there was an update of plex. It was not done automatically this night, and I had to do it manually. What is my mistake here?


Can you please give the full path of the script instead of ./ to start with??

..and probably you need encapsulate your script arument in different way so that it might act as "one" ...so the cron gets less confuse.

Okay, one more thing, you might prefix the shell path too before the script like this /bin/csh your_script_name

....and if you can give us the script too ...so we can see ...take away all the sensitive information from it and give us a barebone one.