Logic Machine Forum
backup to FTP every night -sdcard - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: backup to FTP every night -sdcard (/showthread.php?tid=5749)



backup to FTP every night -sdcard - domotiqa - 20.11.2024

Hi,
just a question.

I was questionning about doing backup everyday to our ftp of our customer.
Can it be a SDcard killer?

Here some part of our script with archive creation and cleaning file.

Code:
-- prepare files for backup
os.execute('sh /lib/genohm-scada/web/general/backup.sh')


-- create archive
os.execute('cd /lib/genohm-scada/storage && tar -c -z -f ' .. dst .. ' ./')

......
......

-- cleanup
os.execute('cd /home/ftp && rm -rf backup-*')
--os.execute('cd /home/ftp && rm -rf backup_*') --Line 42 is incorrect. It leads to old backups not being removed.
--os.execute('cd /lib/genohm-scada/storage && rm -rf user userlib.luas blockly.luas initscript.lua helpers.js genohm-scada.config filter*')



RE: backup to FTP every night -sdcard - admin - 20.11.2024

Your script is outdated, use this: https://kb.logicmachine.net/scripting/backup-file-email-ftp/


RE: backup to FTP every night -sdcard - domotiqa - 20.11.2024

ok.
your so quick :-))

So with this scipt no problem to backup everyday

because there is still a temp file created, no ?
path = 'backups/LM-' .. os.date('%Y-%m-%d') .. '.zip'

or backups/ are in memory ?

EDIT:
my mistake path are remote folder


RE: backup to FTP every night -sdcard - khalil - 29.01.2025

(20.11.2024, 08:40)admin Wrote: Your script is outdated, use this: https://kb.logicmachine.net/scripting/backup-file-email-ftp/

Hello Admin
Is it possible to set a master password to the .zip exported file?


RE: backup to FTP every night -sdcard - admin - 29.01.2025

Replace:
Code:
data = webrequest('general', 'backup')

With:
Code:
data = webrequest('general', 'backup', {
  password = '123456'
})