danmed / TasmoBackupV1

Tasmota Backup TasmoBackup - backup all your tasmota devices in one place.
MIT License
130 stars 20 forks source link

Download All Backups #37

Open jensuffhaus opened 4 years ago

jensuffhaus commented 4 years ago

Add a general download option to download "the latest" or "all" backups of all/selected devices.

This could work with a checkbox list on the device list page to select which devices to download the backup of.

xbmcnut commented 4 years ago

+1 for this.

DaniilMir commented 2 years ago

+1 as well Tried to change backup location to /share/ just to have external access, but it looks like it is not using the host OS shares.

patrickdk77 commented 2 years ago

it will use whatever location you put in for backup location, but if it doesn't have permission to write to that location, it won't work.

DaniilMir commented 2 years ago

That's the question. How to manage host OS folder permissions and how to reference them from the tasmobackup container.

patrickdk77 commented 2 years ago

That is not a question I can answer, that is up to the host system to manage. You have to make the folder, set the permission and attach it someplace, then you can define that someplace it was mounted to in the tasmobackup settings page. You cuold also just mount it to /var/www/html/data to also capture the sqlite database.

The folder should be owned by user #82

DaniilMir commented 1 year ago

I'm thinking now, how can we expose a host OS folder. Like it is described here : https://www.digitalocean.com/community/tutorials/how-to-share-data-between-the-docker-container-and-the-host Maybe it could be a parameter in the config section. And if it is present - add a docker command like "v ~/nginxlogs:/var/log/nginx"

patrickdk77 commented 1 year ago

I don't know what that has to do with tasmobackup though, that is normal docker stuff, and how you opt to run tasmobackup. That is not something tasmobackup cares about, or a config option tasmobackup should care about. It is the default way homeassistant runs all of it's addons though.

DaniilMir commented 1 year ago

@patrickdk77 Problem I'm trying to solve is to make backup files easily accessible. We have a "backup all" button, but we don't have a "download all" button, to get latest backup for all devices. I understand that I can initiate a restore directly from TasmoBackup.
But having a config backup stored elsewhere is reducing the data loss probability. Mostly for those who are using micro SD card.

patrickdk77 commented 1 year ago

If your using docker directly, the instructions for how to run tasmobackup in docker does this automatically. If your running it as a homeassistant addon, then any homeassistant backup would also include all of tasmobackup backup files.

If you are running it some other way, I am not sure I can help you.

PrathikGopal commented 1 year ago

+1 for download all button

DaniilMir commented 1 year ago

If your using docker directly, the instructions for how to run tasmobackup in docker does this automatically. If your running it as a homeassistant addon, then any homeassistant backup would also include all of tasmobackup backup files.

If you are running it some other way, I am not sure I can help you. There are pros and cons as in every solution. For example there can be a device which is not powered up 24/7 like a WiFi RGB lamp. If we have a scheduled backup - it should be done at a time when all devices are up and running. Options: a) Turn all the devices up before TasmoBackub schedule and revert them to a previous state after b) just do a manual backup and keep it somewhere. Because after 14 days old backup will be deleted.

Config backups have a really small size like 4-5 Kb. Having them in a shared folder would be an easy way to access / restore a specific device without UI. Or again at least one button "Download All" to make a snapshot of all devices at the specific point in time - Like Tasmota version upgrade.

PrathikGopal commented 1 year ago

Yeah, it would be better to have the hostname as an optional field on the backup file name. This will greatly help when device has been reset completely.

patrickdk77 commented 1 year ago

I still don't understand why people are asking for a shared folder option. If you installed tasmobackup without a shared folder, every time you restarted tasmobackup, docker, your computer, ..., all your backups would be wiped out. How exactly you setup this shared folder, and how you access it using your computer, I cannot answer, expecially since no one has posted details on how they did it, or what exactly they are having problems with. But all this shared folder stuff is outside of scope, as that should be taken to a how do I use docker forum.

A download All option, may happen, but the amount of changes being requested to make such a thing, requires a major redesign of how tasmobackup manages the backups, and isn't high on the list of features I wish to add, as there are other options to do it, and i don't see the point of such a feature would gain. So far the point thing pointed out is backups, but that should be done by how you normally backup your docker data, or via homeassistant backups. To create some kind of manual backup process that doesn't fit into your automated backup system seems counter productive.

Can anyone explain what use a download all option would give? (besides backups) How exactly they want the download all data to look like (download every backup for every device? only the latest backup for every device?)

So far I only keep seeing the same requests, we need this for backups, we need this for a shared folder, but neither of those are a tasmobackup issue, unless someone can please explain why using the current shared folder method is broken and doesn't work for you, with details. I have not seen a single detail from anyone yet on this topic.

Daniilmir, I think your comments above are not just. Tasmobackup doesn't care if a device is on 24/7, it will back it up whenever it sees the device, normally it checks every hour. Why should you turn every device on before doing a backup? if the device is off, it hasn't changed anything on it, so no need to back it up. If you turn a device on, change it's config, turn it back off, all in under 1hour, you should do a manual backup, I am not sure the usecase of this is to fix, as I cannot think of a case where someone is manually powering something on, changing the settings, then powering it back off, unless the user manually was doing something to it. We only care to backup configs, so catching every change of color setting to a light bulb isn't something that is attempted to backup. backups are not deleted after 14days, unless you configured it to do so, I personally have mine set to 65days, then for longer term backups homeassistant backups saves them, and the nextcloud integration ships the homeassistant backups offsite (that also contains the tasmobackup backups).

I seriously see the point of, backups should be run at a time when all devices are up and running. Any backup solution that requires everything to be working all the time will fail quickly. Tasmobackup doesn't care when a device is online, or when a device is online, It will check all device every hour if it is online and attempt to back it up, UNLESS another backup exists that is fresh enough, default is 23h, so normally once a day every device will be backed up, assume it was powered up that day at all, if you only turn a device on once a week, why would you want to require backing it up daily? just let it grab it once a week when it is on, as it will check for it every hour, until it backs it up. If you have a device you only turn on for 15min a day, or per week, I cannot imagine the config changing on it very often, and you can see the backup is very out of date in tasmobackup and turn it on manually and do a manual backup, or backup all to capture it to refresh it as needed.

PrathikGopal commented 1 year ago

Can anyone explain what use a download all option would give? (besides backups) How exactly they want the download all data to look like (download every backup for every device? only the latest backup for every device?)

For me its because i have the backups stored on my phone for easy restoring, so downloading all files would make it a lot easier than restoring it from a pc/mac when the device has completely reset. As of now your addon allows to download each file individually......what i'm after is a download all button(preferably Latest ones) to the local machine or......a shared folder where i can access it once its saved the backups. Also as stated earlier to have the hostname as the file backup name so that i know which file when the devices are fully reset.

JohnnyPicnic commented 1 year ago
Looks like its possible to map the home assistant directories to the docker container. ` map list   List of Home Assistant directories to bind mount into your container. Possible values: config, ssl, addons, backup, share or media. Defaults to ro, which you can change by adding :rw to the end of the name.

`

I would also like to be able to export all backups and access them from SMB.