--Take a backup and ftp to NAS-- name of backup filesrc = 'backup-' .. os.date('%Y.%m.%d_%H-%M') .. '.tar.gz'-- where to put backup file on LMdst = '/home/ftp/' .. src-- where to put the backup on NAStarget = '<ftpdir>' .. src-- prepare files for backupos.execute('sh /lib/genohm-scada/web/general/backup.sh')
-- create archiveos.execute('cd /lib/genohm-scada/storage && tar -c -z -f ' .. dst .. ' ./')
-- load the ftp supportlocalftp = require("socket.ftp")
localltn12 = require("ltn12")
-- ftp to NASf, e = ftp.put{
host = "<ip_address_of_ftp_server>",
user = "<ftp_user>",
password = "<ftp_user_pwd>",
type = "i",
argument = target,
source = ltn12.source.file(io.open(dst, "rb"))
}
if (e) thenlog (e)
log (f)
alert("Could not ftp: ", e, "\n")
endlog("ftp_backup")
-- cleanup os.execute('cd /home/ftp && rm -rf backup_*')
os.execute('cd /lib/genohm-scada/storage && rm -rf user userlib.luas blockly.luas initscript.lua helpers.js genohm-scada.config filter*')
thanks i use it for a small month for now.
it did worked for me for 12 days without problems. after these days, i only get a backup of 0 Bytes.
all is working again, i think there where to big pictures and my export was 25MB.
But after this i didn't saw there is an issue.
My question, is it possible to get an error when the backup is just 0 bytes or below 100kb?
because vacation and try to make more scripts these week, and my LM who create bad backups.
is it also possible to just make a backup from only the scripts on the LM and sent them with ftp?
i know the option to make backup by 'Backup scripts' but maybe it is also possible to do it automatic?
Hi, the latest E-mail backup script fails for me (error is nil) and still responds email send. Is there some kind of file size limit if using gmail? I have 17 logicmachines in one location and a few works (the backup file size is about 150 kb), but all the bigger ones (about 800kb) fail to send the mail.
22.03.2022, 14:30 (This post was last modified: 22.03.2022, 14:32 by Dré.)
Yesterday i was logged in to my Wiser/LM
i saw there all my backups still on my Wiser.
The script is working, i got my backup on my FTP server, but the backups are also still on my Wiser, it looks like, they don't delete the backup files.
my question is, is there something wrong with my clean up line?
Thanks Admin, now i see what is was going i\on, i changed the name, from Backup to Project, and with this rule, you delete is, but he couldn find the file.