Backup to a NFS share - lower SD Card writes

Hi,

I ask me if it is possible to create the backups directly to a network share like NFS instead of writing it to a local file. I like to avoid unnecessary writes to my Raspberry PI SD Card. I now that there are some Backup plugins to e.g. copy the created file to WebDAV but is there anything against mounting a share to the backup folder?

If there is nothing against I would perhaps write a little plugin to check mount status before starting the backup (if there are events available, etc. etc.)

Cheers,
Nils

It wouldn't be unheard of to symlink the backup folder ~/.octoprint/data/backup to a NFS share and there are events that you can use to validate the access: Backup Plugin β€” OctoPrint master documentation.

I would be willing to add that into my backup scheduler plugin if you wanted to submit a PR.

Hi,

started with the implementation and the handling is working fine. I found the following function in JS and it seems not correct, as the functions called are not available. Is this a bug?

return self.settingsViewModel.settings.plugins.backupscheduler.backup_daily() || self.settingsViewModel.settings.plugins.backupscheduler.backup_weekly() || self.settingsViewModel.settings.plugins.backupscheduler.backup_monthly()

Also do you have perhaps an idea with PNotify...I want trigger an notification that is available even after refreshing the GUI. An error notification is deleted after a refresh...I can trigger it every time on login but perhaps there is a direct way to sustain it.

Cheers,
Nils

it's a knockout binding thing. those are ko objservable references to the plugin's settings. once the binding actually happens those become available internally to the viewmodel because of the dependency binding to settingsViewModel.

I'm not aware of any method of using send_plugin_message and flag it to retain a message. That would be a cool feature request to core if it's not possible though. Probably easiest to tie an internal flag/message to a setting and then onAfterBinding callback of the view model check that flag/setting and call the onDataUpdaterPluginMessage function with the necessary plugin_identifier and message that you would have sent from the python side normally.

Actually looked at the code....haha...yes that is probably a bug. backup_daily doesn't appear to be in the default settings anymore. Strange as I don't remember that being an issue.

Ah, looks like a left-over computed observable that is no longer in use and just never was removed...the jinja template side that was using that was deleted in this commit several version back.

Something like that...must be still available but not for plugins as the e.g. update notification has to be confirmed. Perhaps its easy to implement. Will open a second discussion for that.