hassio-dropbox-sync icon indicating copy to clipboard operation
hassio-dropbox-sync copied to clipboard

Add option not to skip existing files

Open rsuplido opened this issue 7 years ago • 8 comments

First, thanks for the add-on!

I've automated my backups to run Monday, Wednesday, Friday and name the backup files like _Snapshot.tar. Looking at the code, it seems like you are using the -s upload option to skip existing files in Dropbox. Will you be able to provide a setting to not use the -s option so it would just overwrite/update files in Dropbox?

TIA.

rsuplido avatar Oct 03 '18 17:10 rsuplido

I think that's a good idea. I'll try to add an option soon.

danielwelch avatar Oct 04 '18 20:10 danielwelch

Nvm. it looks like HA still uses a system generated filename and you can only change the label for that snapshot.

rsuplido avatar Oct 07 '18 18:10 rsuplido

Hi @danielwelch. I too fell the "skip existing files" as an option (on/off) would be a great additional feature. Is it coming ? Fantastic job

nmsoares avatar Nov 02 '18 18:11 nmsoares

Hi @danielwelch

This can be an useful option for me too.

Fantastic addon for Hassio.

Thanks

woody4165 avatar Nov 07 '18 14:11 woody4165

I was pointed to this issue to see if I could provide some input. In http://github.com/d0ugal/hassio-dropbox-upload we calculate the file hash and compare it with the one in dropbox and only re-upload the file if the hash doesn't match (i.e. the filename is the same but the contents is different).

It works fairly well, but you need to calculate the hash in a specific way so you get the same one as you get from the Dropbox API. Here is the code: https://github.com/d0ugal/hassio-dropbox-upload/blob/master/dropbox-upload/dropbox_upload/dropbox.py#L43-L52 (I found and adapted the code from an example in the docs iirc).

... but I'm not sure if this is possible at all with the dependency on the parent script. So you might just need to re-upload everything? My full snapshots are 2gb, so that would be a bit slow :smile:

d0ugal avatar Nov 15 '18 16:11 d0ugal

Thanks for the input. I’m actually working on another snapshot addon that uses your code for Dropbox functionality, so I’m very familiar with the code 😄 it works great! In short, this add-on is basically just a wrapper around that script, so while we could work around it, might as well just rewrite the whole thing in python. Your add-on is great for that, and I’m hoping to have mine available soon. Still working on it and testing, haven’t had much free time lately. But, big picture, I plan to move my efforts to that addon as we keep running into the limitations of the Dropbox uploaded shell script.

danielwelch avatar Nov 15 '18 17:11 danielwelch

Interesting. Sounds good. Happy to team up if I can help at all.

d0ugal avatar Nov 15 '18 21:11 d0ugal

@danielwelch any news on this update/fix ?

nmsoares avatar Jul 20 '19 21:07 nmsoares