dav-sync push doesn't upload missing files on server
Powerful webdav client and sync tools with client-side AES encryption
Brought to you by:
pyrphoros,
uap-universe
I think I've found a bug (or feature depending on how you look at it).
It's easy to reproduce:
webdav server using "dav-sync push". All is fine.
but still the webdav server is missing one.
"mkcol" but the files in the directory are not synced.
Of course dav-sync syncs the LOCAL changes to the server and in this
example there are no local changes. But if you just want the webdav
server be a copy of a local directory, this cannot work. So, I only
would like a sync from local to remote (one direction) and if for what
reason a file is missing on the server it should be uploaded again.
Greets,
David
This behavior is intentional, because dav-sync is designed for a bidirectional sync and you may want to sync the file deletion. So in this case, after the file is removed from the server, dav-sync pull will delete the file locally.
Therefore what you want is a missing feature. The actual bug is that directories are recreated on the server.
But I just added some options for the push command that allow you to restore missing files on the server.
This will not only upload all locally changed files, but also files, that are missing on the server.
With this option, files that are modified on the server will be replaced with the local version.
Of course you can combine both options to ensure the server has always the same files as the client.
To use the new features, you need the latest source code from the hg repository. I hope this helps.
Last edit: Pyrphoros 2018-07-11
Thanks a lot.
I just tested it and the -R and -M options seem to work fine. The "mkcol bug" is still there but you didn't fix that yet, I assume.
I use your tool because of the unidirectional sync so this really a good enhancement.
I still don't know in which case dav-sync doesn't create the directory before the file is uploaded, but it doesn't matter because I added the check for the 404 status code. The problem shouldn't occur from now on.
I meant the mkcol bug in this discussion: if you remove a directory on the server, dav-sync recreates it again (without any content). For me it's no problem because I will use -R and -M but it's not about me here ;)