0
I would like to use the return of a for that list files from a directory to use in a Mysql command, but I can’t get all the files. thanks in advance for the help!
#Lista os arquivos do diretorio somente os arquivos de log
for i in glob.glob("C:\Backups\Logs\*.0000*"):
lista = [i]
#Busca no banco de dados o ultimo Id inserido
cursor = conn.cursor()
cursor.execute('Select * from logbin where Id = (select max(Id) from logbin)')
recordset = cursor.fetchall()
for record in recordset:
print (record[1],"-->", record[2])
#Improta comandos do cmd - pip install plumbum.
from plumbum.cmd import mysqlbinlog
print ( mysqlbinlog [lista, '-rC:\\Backups\\Logs\\Binlog.txt']())