Example #1
0
 def DeleteAllTask(self):
     mysql = MySQLHander()
     sql = "select target,data from task where success=1"
     mysql.query(sql)
     slist = mysql.fetchAllRows()
     for line in slist:
         sql = "insert into successlist(`target` ,`data`) values (\"{0}\")".format(line[0], line[1])
         mysql.insert(sql)
     sql = "delete from task"
     mysql.update(sql)
     mysql.close()
     print "[!] task schedule has been clear!"
Example #2
0
def Save_Success_Target():
    while True:
        mysql = MySQLHander()
        sql = "select taskid,target,data from task where success=1 and action=0"
        mysql.query(sql)
        resource = mysql.fetchAllRows()
        if resource != None:
            for line in resource:
                sql = "insert into successlist(`target`, `data`) values (\"{0}\", \"{1}\")".format(line[1], line[2])
                mysql.insert(sql)
                sql = "update task set action=1 where taskid='{0}'".format(line[0])
                mysql.update(sql)
                print '[*] save success target {0}'.format(line[1])
        mysql.close()
        time.sleep(3)