Running script in Jail using cron.

Status
Not open for further replies.

moltra

Dabbler
Joined
Dec 7, 2011
Messages
26
I am running Lenovo ThinkServer TS140 i3-4130 3.4GHz with 16 GB of ram. I have 3 1TB drives connected in a Raid-Z1 configuration.

Freenas version: FreeNAS-9.3-STABLE-201501241715


I am trying to get a python script to automatically update my dynamic IP address at godaddy. I have the script setup and I can run it from the jail command line, but if I try to run it from the root shell I get the following error.

command: python2.7 /mnt/vol1/jails/misc_python_1/pyapps/godaddy.py
mo module names pif.

But if I run it in the jail shell it runs fine. Any help is greatly appreciated.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
You want to add it to the crontab of your jail, not the main OS.

Code:
jls
sudo jexec <jail number> sh
crontab -e
<add the cron line to run your script>


You may need to make changes to the PATH or PYTHONPATH environment variables in order for the script to find the resources it needs.


Alternatively, FreeNAS can update Dynamic DNS records for you. I'd bet you can configure this rather than rolling your own python script: http://doc.freenas.org/9.3/freenas_services.html#dynamic-dns
 
Status
Not open for further replies.
Top