hi! I need to run this
import time def bookings(): import datetime allBookings = db(db.current_bookings).select() db.commit() for booking in allBookings: if booking.enddate >= datetime.datetime.now(): buildingName = booking.project room= booking.platform table = getattr(db, '%s'%buildingName ) toUpdate = db(table.id == room).select() db.commit() for t in toUpdate: t.update_record(room_owner = 'Free') db.commit() booking.delete() db.commit() else: pass while True: bookings() time.sleep(1) as a background service, I tried with cron (nothing happened) could you tell me if is something wrong with my script?? or how should I run it?? as a command line script?? or via cron??