I can look into this. It seems like it should be possible but the addon will likely be required to use the hassio API. I’m imagining an option keep-last, which if set, will trigger calls to the hassio api to get date of all snapshots, and delete all but the last 5. I’d probably implement this in a separate python script. That’s run after an upload and only if keep-last is set.
Alternatively, this functionality could be exposed as a separate command, with its own option for keeping the last N snapshots.
Actually with keeping snapshots, it would be even better if it was handled in the Hassio Snapshot function anyway. There is no way to even delete snapshots from the GUI - all you can currently do is delete them in Samba or scp, so if this could be run from your addin would be handy.
I prefer your Dropbox approach over what I was doing with thumb drive. Dropbox is much more flexible and it’s nice to know backups are stored in the cloud…
I just have 2 seperate automations. The backup one runs an hour after the snapshot one and also notifies me it is complete. Running both at the same time won’t work as it needs time to make the backup.
This looks like something I will be including in my configuration. I was curious about having an automated backup. How about updating to Google Drive or a private FTP instead? Is it simply pointing the code to those specific locations and credentials?
There are other add-ons for FTP, including one in the Community Add-on repository which I assume is good.
This add-on makes use of the Dropbox-uploaded bash script. Uploading to Google Drive would probably best be implemented in a separate add-on. I can look into making one if there’s interest.
I like the idea of using Dropbox instead honestly. I was just curious about the other options. I have not actually installed HA yet and I am not familiar yet with the available add-ons. Hopefully tomorrow all my RaPi parts come in so I can get starte! Thanks @danielwelch
Forgot to update the “at” time, I’m running it 2 hours after snapshot, but something is not working correctly, I’m guessing I got the data_template wrong, what does your automation look like?
I’m trying to make this work, but getting error’s in the log.
I just installed the addon today, after updating HASS.IO to 6.4.
This is what I’m getting:
Invalid service data for hassio.addon_stdin: extra keys not allowed @ data['name']. Got {'addon': '7be23ff5_dropbox_sync', 'input': {'command': 'upload'}}
required key not provided @ data['addon']. Got None
required key not provided @ data['input']. Got None
Any clue why? I tryed uninstalling the addon, and readding repo, same error when triggering automation…
I haven’t given this a shot yet. It is probably possible to do something like this using the Hass.io API, which would let me get the date for each snapshot. I’ll try to add that functionality soon.