I am using the FreeBSD variant as seen below:
[2.2.4-RELEASE][root@ROUTER.local]/home/Script_to_monitor_power: uname -a
FreeBSD ROUTER.local 10.1-RELEASE-p15 FreeBSD 10.1-RELEASE-p15 #0 c5ab052(releng/10.1)-dirty: Sat Jul 25 20:20:58 CDT 2015 root@pfs22-amd64-builder:/usr/obj.amd64/usr/pfSensesrc/src/sys/pfSense_SMP.10 amd64
I have written a python script that runs sucessfully using the below commnd in CLI:
/usr/local/bin/python2.7 /home/Script_to_monitor_power/power_alarm_t2.py
The python script contains a shebang line as below:
#!/usr/bin/env python2.7
The location of python2.7 is as below:
[2.2.4-RELEASE][root@ROUTER.local]/home/Script_to_monitor_power: where python2.7
/usr/local/bin/python2.7
My objective is to run the above script as a cronjob. So i make my script executable using
[2.2.4-RELEASE][root@ROUTER.local]/home/Script_to_monitor_power: chmod +x power_alarm_t2.py
I have the edited the crontab as below:
[2.2.4-RELEASE][root@ROUTER.local]/home/Script_to_monitor_power: crontab -l
* * * * * /usr/local/bin/python2.7 /home/Script_to_monitor_power/power_alarm_t2.py
I also do:
[2.2.4-RELEASE][root@ROUTER.local]/home/Script_to_monitor_power: cron reload
cron: cron already running, pid: 43420
Now when i do:
[2.2.4-RELEASE][root@ROUTER.local]/home/Script_to_monitor_power: ps -ef | grep cron
Q: My cronjob is not running after every 1 min. Please suggest what am i missing?