crontab is failed to execute my python script
hi everyone, here is my problem when using crontab...
i am using linux mint 5...
i am trying to execute 1 shell script and 1 python script
the shell script is run normally, but the python script cannot be execute... while i try using execute using terminal its run normal...
here is my crontab -e:
*/5 * * * * /home/inamorato/Desktop/psm/scripts/find-bluetooth.sh /home/inamorato/Desktop/psm/data/bt-devices.csv
*/2 * * * * /home/inamorato/Desktop/psm/execute-server.py
the 1st command which recurrent every 5 mins is run normal in crontab job but the 2nd command cannot be execute...
when i try to run the task from gnome-schedule, an error pop up...
error message:
ERROR: No section: 'sql'
Exception exceptions.AttributeError:v "'outgoing' object has no attribute 'conn'" in<bound method Outgoing._del_of <Outgoing(Thread-1,initail)>>
ignored
i don't really know what is happening here... any1 can help me please?
and here is the python scripts i trying to execute
execute-server.py
----------------------------------------
----------------------------------------
#!/usr/bin/python
from Bluvert.Outgoing import Outgoing
import sys
try:
outgoing = Outgoing()
outgoing.run()
except Exception, ERR:
print "ERROR: " + ERR.message
sys.exit(2)
Outgoing.py
---------------------------
---------------------------
#!/usr/bin/python
from pysqlite2 import dbapi2 as sqlite
from threading import Thread
import Base
from SendWorker import SendWorker
import ConfigParser
import string
import sys
import os
import shutil
import datetime, time
class Outgoing(Thread, Base.Base):
def __init__(self):
Thread.__init__(self)
Base.Base.__init__(self)
def run(self):
active_adapters = self.get_adapters_in_neighbourhood()
self.dbg("There are '" + str(len(active_adapters)) + "' adapters in your bluetooth neighbourhood")
for adapter in active_adapters:
sender = SendWorker(adapter)
sender.send_outstanding_messages()
def get_adapters_in_neighbourhood(self):
result = []
bluetooth_csv_file = self.config.get("data", "current_bluetooth_devices")
if os.path.exists(bluetooth_csv_file) != 1:
raise Exception("Bluetooth CSV file '" + bluetooth_csv_file + "' does not exist")
f = open(bluetooth_csv_file, "r")
for line in f:
elements = line.split(";")
result.append(elements[0])
return result
thanks in advance...
|