Posts: 400
Threads: 88
Joined: Jul 2016
Reputation:
3
Dear all,
before writing, I read all post about this thread but no post clearify what I would like to do.
I would like to export and send by mail all my csv files log. After that I would like to delate the csv file in order to keep the memory clean and light.
What do you suggest? Furthermore I do not konw how I can clean memory of trend manually?
Thank you for your help.
Regards.
Posts: 7772
Threads: 42
Joined: Jun 2015
Reputation:
447
In some cases you don't need to store the file at all, just generate it in your script and send via e-mail as attachment.
Trends cannot be "cleaned". Database is allocated to support all data at once, so even trend without any data still has the maximum size depending on selected data range.
Posts: 400
Threads: 88
Joined: Jul 2016
Reputation:
3
Ok, so what' your suggestion about it?
What's a script the generate the file?
Thanks.
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
Hi,
Not sure but i think there is no data in your fetched result. You probably have set the scope to narrow. Have you logged the raw result from the fetch command?
BR,
Erwin
Posts: 400
Threads: 88
Joined: Jul 2016
Reputation:
3
Consider that this error is shown when I launch the script but the file should be sent in the next 12 hours as per my setting. Or this error stop the script?
Posts: 400
Threads: 88
Joined: Jul 2016
Reputation:
3
Thank you buuuudzik!
I use your scritp and it works. But I would like to do is save data in a CSV file and sending it by mail. I cannot mix your script with the one suggest by Erwin.
Thanks.
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
Hi,
Like the script says:
--****************** DON'T CHANGE ANYTHING UNDER THIS LINE *****************--
--**************************************************************************--
But you changed this line:
trends_table = db:getall('Temperatura - Giorno') -- This is not a valid query
Set it back to original:
trends_table = db:getall('SELECT name FROM trends ORDER BY name DESC')
BR,
Erwin