logrotate for z-way-server
-
rafale77replied to prophead on May 11, 2020, 8:41 PM last edited by rafale77 May 11, 2020, 8:59 PM
I am just now getting to understand what you are trying to do...
You can use the same script above and change the file to the openLuup user-data.json file and change the number "9" to "5".
Also remove the "killall" line. -
akbooerreplied to prophead on May 11, 2020, 9:25 PM last edited by akbooer May 11, 2020, 5:26 PM
@prophead said in logrotate for z-way-server:
could I use this make automated backups of my openluup user_data file?
Just to say that openLuup has a built-in CGI to accomplish this (files backed up to the cmh-ludl/backups/ folder in LZAP compressed form by default.) These may be used to directly restore an openLuup configuration. You could trigger the backup with a timed scene.
The openLuup console Backup page shows the available backups...
-
I use the backups manually. I want automated with rotation. Why hack lua to do this if its easy in os?
-
akbooerreplied to prophead on May 11, 2020, 9:39 PM last edited by akbooer May 11, 2020, 6:00 PM
@prophead said in logrotate for z-way-server:
I want automated with rotation.
The openLuup plugin has a
SendToTrash
action which internally uses a file retention manager which can limit the number of files in a folder to:- the most recent N
- files younger than a certain number of days old
- only certain file types
Again, this can be run from a regularly scheduled scene. Files are temporarily moved to the Trash folder but may be permanently deleted by the
EmptyTrash
action of the openLuup plugin.The same procedure can be used to manage image files.
I don't call this 'hacking Lua'
-
Can't seem to get the SendToTrash action to work either, heres my attempt:
luup.call_action ("openLuup","SendToTrash",{Folder="/etc/cmh-ludl/backup",MaxDays="",MaxFiles="10",FileTypes="lzap"},2)
I really wish you would put examples in your documentation.
the log files showluup_log:2: applying file retention policy... luup_log:2: ...finished applying file retention policy
but the files are still there.
Any help?
|-<:) -
@prophead said in logrotate for z-way-server:
expected backup to be an action. Apparently not.
Yes, I would have expected that too... except that we are talking about a Vera feature here, which is used by the AltUI interface, so it has to be done this way to be compatible.
What is the best way to call a local cgi?
In this case, you need:
luup.inet.wget "/cgi-bin/cmh/backup.sh?"
HTH
-
akbooerreplied to prophead on May 13, 2020, 9:23 AM last edited by akbooer May 13, 2020, 5:24 AM
@prophead said in logrotate for z-way-server:
Can't seem to get the SendToTrash action to work either, heres my attempt:
Yes indeed, another appallingly badly documented feature.
In order to prevent an ill-advised programmer from wreaking havoc, absolute paths are not allowed. So you should use:
luup.call_action ("openLuup","SendToTrash",{Folder="backup",MaxDays="",MaxFiles="10",FileTypes="lzap"},2)
In addition, certain key folders are denied access, including
openLuup, cgi, cgi-bin, cmh, historian, whisper, files, icons, www
I will try to improve the documentation.
22/23