Fjodor42 / jottalib-ng

GNU General Public License v3.0
9 stars 0 forks source link

Jotta-Download not working as expected (cf. Desktop Clients) #12

Open rix1337 opened 6 years ago

rix1337 commented 6 years ago

https://github.com/havardgulldahl/jottalib/issues/151

I have tried to recreate the Windows-Sync experience as advertised in this project.

What I want: direct jottalib to some folder where it will download everything from jottacloud.com and download/upload on file changes. This behaviour can be seen when using the official Windows client and is comparable to Googles "Backup and Sync" or the "Dropbox" client.

jotta-scanner only uploads stuff to a specified folder.. this seems to be the wrong command It also does not care about changes on jottacloud.com .. if I delete files from the online sync folder, they will be reuplaoded instead of deleted ><

jotta-download forces me to explicitly state either a directory or a specific file from the top level directory of jottacloud.com

Please add an option (eg allowing / as a valid top-level directory marker) so I can keep my complete sync folder up to date locally.

Also, if I use jotta-download I get the jottalib_ng.JFS.JFSNotFoundError: https://www.jottacloud.com/jfs/XXX.rar does not exist (no.jotta.backup.errors.NoSuchPathException) on files that are available through jotta-ls

Fjodor42 commented 6 years ago

Hi @rix1337 ,

First of all, there is some sync functionality in the project that I cloned from @havardgulldahl, but I must admit that this part hasn't been much of a point of focus for me.

Regarding the specific jotta-download failure, could you possibly create some non-descript path that you wouldn't mind sharing, and then give the complete jotta-download command that fails to download said file?

Thing is that I might have introduced some changes to the path specification syntax and forgotten to reflect that in the documentation...

Fjodor42 commented 6 years ago

...and as for full-dir download by specifying just the path to a folder, would be really neat, but I would want to also implement some sort of check as to whether the local file exists, and then prompt (or assume prompt answer from flags) as to whether to overwrite, skip download if the hashes match, or skip download altogether...

rix1337 commented 6 years ago

My main use case would be keeping a complete local copy of my sync-dir for backup purposes. So jotta-download is of my main concern.

Okay, so from what you are saying: a) Sync is in the original state (the one that I find incomplete) - likely hard to fix/change b) Regarding my error you need the full path - I can provide that later c) Full dir download without redownloading existing files is not implemented as of now? That's a shame.

I am just self-tought at python so I will not be of much use.. I had just hoped jottalib was more advanced.

Even though I am unfamiliar with the code-base here are my thoughs on c)

Allowing the top dir should be fairly easy, right? Either through a new command like jotta-download-all or just allowing a special char like / or *

Then the file check would boil down to something like (on every file to download)

if filepath exists:
  if not hash(filepath) is hash(onlinefilepath) #might be slow
    redownload(filepath)
  else:
    log(filepath + "skipped"

the above being pseudo

Assuming jottacloud provides hashes through its api. the guys at Duplicati have managed to implement that AFAIK

Fjodor42 commented 6 years ago

Ad a) Not necessarily, but my time is scarce...

Ad b) Indeed - but as inspiration, for me, to download, say, "Archive" > "backup" > "file.name", I would do jotta-download '//Archive/backup/file.name', so if a similar command works for you, please just report back with success on that front.

Ad c) Honestly, I cannot remember, but I don't think so - I'd appreciate it if you tried, though, and reported back ;-)

As for both a) and c), you'd be welcome to give it a go anyway - self-taught doesn't necessarily mean inept - but as said, my own time is scarce, although I do want to do it, as it would certainly ease my own use of the service and lib.

Other are also most welcome to give it a go, or you could ask someone, if you know someone who might want to do it ;-)