This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

trend export via csv
#7
(19.09.2022, 07:43)Gadjoken Wrote: Hello,

Can you confirm that this script by erwin Van der Zwart that i adapted allows you to send all the trends to a remote FTP server?

Code:
src = 'Trend Export '.. os.date('%Y-%m-%d %H#%M#%S') .. '.csv'
dst = '/home/ftp/' .. src
io.writefile(dst, buffer)




local ftp = require("socket.ftp")
local ltn12 = require("ltn12")


-- Indiquer le dossier du serveur FTP dans lequel vous souhaitez mettre le fichier CSV des courbes
target = '/EXPORT/Courbes/' .. src

--Indiquer HOST / USER / PASSWORD
f, e = ftp.put{
  host = "192.168.54.246",
  user = "FTP-User",
  password = "my_password",
  type = "i",
  argument = target,
  source = ltn12.source.file(io.open(dst, "rb"))
 
}

if (e) then
  log (e)
  log (f)
  alert("Could not ftp: ", e, "\n")
end
log("ftp_trends")


os.remove(dst)


Thank you for your understanding.
Best regards.

Hi

I am doing the same here on an ftp I have set up. I can modify the directories and add files from remote computer with the user I have set up, but when I try to write from SL I get "550 Permission denied". Any idea why?

I have disabled the FW on the remote computer. I get no error when connecting (tried with wrong user/pw, and then I get the expected login-failure).
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply


Messages In This Thread
trend export via csv - by PassivPluss - 19.10.2016, 19:12
RE: trend export via csv - by PassivPluss - 19.10.2016, 20:03
RE: trend export via csv - by benanderson_475 - 10.12.2019, 19:39
RE: trend export via csv - by Gadjoken - 19.09.2022, 07:43
RE: trend export via csv - by Trond Hoyem - 16.01.2023, 14:03
RE: trend export via csv - by admin - 16.01.2023, 14:12
RE: trend export via csv - by Trond Hoyem - 16.01.2023, 14:18
RE: trend export via csv - by admin - 16.01.2023, 14:20
RE: trend export via csv - by Trond Hoyem - 16.01.2023, 14:31

Forum Jump: