Change expiration setting of auto backup of recording schedule / recovering older backup schedules

rodp

Member
Hi All,

I need to revert back to a recording schedule backup from about 2 months ago, but the normal list only goes back 14 days. I found them in /mnt/hd2/mod/var/backup but the list is the same as per what you see in the webif UI. How likely will it be to retrieve an older version using some sort of undelete method?

Also, can I increase this expiration time. Thanks.

Rodp
 
I expect this ought to be a configurable setting.
I've looked around on the webif UI but can't find anything. Could this be made configurable in the future then? Is there a wish list thread somewhere on this community? :):thumbsup_:
 
How likely will it be to retrieve an older version using some sort of undelete method?
:rolling:

hd2 is the main partition, which includes recordings. Presuming you are recording on a regular basis, the blocks are getting re-used on a regular basis.

The other thing is how? I'm less familiar with Ext file systems, but file recovery in FAT pretty much relies on the quirk that file deletion is only a process of marking a directory entry as deleted, so if you get to it in time all a utility has to do is present you with a list of files marked as deleted so you can manually undo the corruption which that caused – just reinstate the first character of the file name. Then, provided the data blocks have not been written over in the mean time, the file is restored. But I very much doubt Ext works like that.

Forensic file recovery involves reading blocks from the HDD raw, and recognising patterns in the data to figure out what sort of file they belong to, then piecing blocks together to make complete or partial files. Like constructing a jigsaw of blank pieces.

Any utility that might be available in Linux-land would need compiling for the HDR-FOX, and that's not necessarily easy either.

Also, can I increase this expiration time. Thanks.
That sounds more do-able, as a future possibilty.

But I have to question how much use a 2-month old schedule is anyway.
 
But I have to question how much use a 2-month old schedule is anyway.
It becomes useful when your kids mess around with the humax accidentally deleting scheduled items and I've been busy for a few weeks so not realised what's happened. :) So having a longer backup will help.

Found the feature request thread and have added an item. It's odd as I wasn't aware of this thread but it was saying that I was watching it yet I don't think i've ever had any email alerts about it. I've now unwatched it and watched it again.

Thanks

Rodp
 
Manual backups never expire - My oldest is dated 2015! so just create a manual backup every few days or before significant events that you might want to restore to.

Practically old backups are of little use - I am too lazy to clean up the list!

If required it should be possible to automate the taking of manual backups or renaming an auto- backup file to something else

It is the prefix 'auto-' in the filename that is used to determine the difference between auto and manual backups, the 15 days is currently hard-coded but could easily made a setting
The relevant piece of code is in /mod/webif/html/sched/backup/backup.jim

Making the changes would be an ideal first project for a newbie webif developer so why not try @rodp !
 
Making the changes would be an ideal first project for a newbie webif developer so why not try @rodp !
Well if people don't mind me breaking their humax then I'm game! ;) To be honest, I'll probably just look at the.Jim file in notepad ++ and change the expiration from 14 to 60 days as I wouldn't know where to start in terms of adding a new section to the webif settings page, nor creating an update package! I know you've got to start somewhere when it come to programming (my forte is VBA and a very minor understanding of HTML and JS). However, would this not be stepping on the original author's toes as it were. I'd feel a little uneasy about doing that. Unless..... MymsMan are you the author?!
 
Really, the answer is just to make a manual backup when you're happy with the setup and want something that can be restored.

However, if one wanted to make the expiration configurable, it's a question of directed plagiarism:
  • the backup code is in /mod/webif/html/sched/backup
  • the settings code for WebIf modules is in /mod/webif/html/settings/modules/web
  • each settings.hook file is a Jim script that generates HTML and JS embedded in the Settings webpage, using values set by the corresponding init.hook Jim script
  • the template code typically includes a <form> whose data is submitted to the WebIf server and redirected to a CGI handler in the init.hook.

So one would look at those having in mind how the expiration value should be persisted. mod/webif/lib/settings.class could be extended with a new setting member (in the end, saved as a row in the settings table of /mod/etc/webif.db). Then
1. set that value, with 15 as default, into a variable that replaces 15 in the backup code
2. add some template HTML in the settings.hook for setting a positive integer value (maybe >= 2?) with code in the init.hook to set the current value and later handle_int_update it (this is where plagiarism can be helpful: look at settings in other modules for examples).
 
The biggest hassle with doing this is working out which section to put the setting in. It doesn't really fit in anywhere, so it'll probably end up in General.
I guess the limits should be something like 7-56 days with a default of 15 as now (8 weeks should be enough for anybody, to paraphrase).
 
Well if people don't mind me breaking their humax then I'm game! ;) To be honest, I'll probably just look at the.Jim file in notepad ++ and change the expiration from 14 to 60 days as I wouldn't know where to start in terms of adding a new section to the webif settings page, nor creating an update package! I know you've got to start somewhere when it come to programming (my forte is VBA and a very minor understanding of HTML and JS). However, would this not be stepping on the original author's toes as it were. I'd feel a little uneasy about doing that. Unless..... MymsMan are you the author?!
I am not the auhor, @af123 wrote most of it, he is no longer actively developing it, but it has always been a collabrative effort, before any updates were actually incorporated into the distributed webif they would need to be approved by @prpr amd/or @/df but they don't bite (too hard). The updates would spend some time in beta test before being released to the masses. The process is documented here and the JIM/TCL language used here

Making baby steps limited to your own machine is the best way to get started, be careful if using an editor on a windows machine that it doesn't lose the exceutable flag when saving the file or save witth windows style cr/lf line endings.
If I were making the changes I would probable add the new setting to the Advanced tab of the Settings page (copying the code for one of the existing numeric settings). I would also add an optional file name parameter to backup.jim to make it easier to call from the command line or to automate from crontabs
 
It becomes useful when your kids mess around with the humax accidentally deleting scheduled items and I've been busy for a few weeks so not realised what's happened.
...so you've lost a load of recordings as well. That will take more than a tweak to the expiry date to put right. But there's more than one way to skin a cat, such as programming your recordings using RS searches.
 
The biggest hassle with doing this is working out which section to put the setting in. ...
On reflection general or advanced would be better than web. One might consider why the modules in the settings don't directly correspond to subdirectories of /mod/webif/html: what sort of modules are they?

...
...add an optional file name parameter to backup.jim to make it easier to call from the command line or to automate from crontabs
...
+1
 
On reflection general or advanced would be better than web. One might consider why the modules in the settings don't directly correspond to subdirectories of /mod/webif/html: what sort of modules are they?
I think a lot results from accidents of history! I think if the package hook in mechanism had been invented on day 1 the base webif package would be a lot smaller and each of the subcomponents would have been developed as separate sub-packages

There was a time when the setting panel was a single huge monolithic panel without the individual selectable sections
 
be careful if using an editor on a windows machine that it doesn't lose the executable flag when saving the file or save with windows style cr/lf line endings.
This is easy to say, but hard to guarantee. A better way would be to use the editor built in to the WebIf.
add the new setting to the Advanced tab of the Settings page
This is where it has ended up, after a reconsider.
I would also add an optional file name parameter
Also done. You can specify the prefix on the command line and it will replace "auto" with whatever you specify.
 
You can specify the prefix on the command line and it will replace "auto" with whatever you specify.
Working nicely.

If you want to create weekly and/or monthly backups you could add the following (or similar) to crontabs using the file editor off the Diag menu
Code:
0 21 * * 1 /mod/webif/html/sched/backup/backup.jim Weekly >>/mod/tmp/schedbkup.log
0 22 12 * * /mod/webif/html/sched/backup/backup.jim Monthly >>/mod/tmp/schedbkup.log
In the above the weekly backup would occur at 21:00 every Monday (day 1) and the Monthly at 22:00 on the 12th of each month
 
Back
Top