Closed neiljackson1984 closed 3 years ago
@neiljackson1984
I expect the sync client to delete all of the originally-existing files in the OneDrive repository, so as to make the OneDrive repository empty, to match the state of the syncdir. However, what actually happens is that the sync client does not delete any of the existing files in the OneDrive repository.
This is not a bug or issue. The reason for this is as follows:
In your use case, you are expecting an 'empty' local directory to be your source of truth, but each time you are running the client, you are actually using OneDrive as your source of truth
This is why you are seeing this behavior.
There is no real easy way to just 'delete' everything like you are attempting to do. Suggest that you look at:
Closing issue, as this is not a bug / issue.
Abraunegg, thank you for the extremely rapid response. I had experimented with the --local-first option without much luck (just as you mention). Perhaps I should change this to a feature request for a "complete mirroring" feature. Is there a way to get the local cache db in sync with the cloud without having to download the files from the cloud (i.e. to put the database into the same state that it would be in after doing a --synchronize starting with an empty syncdir and downloading the entire repository from the cloud, but without actually having to perform the download.)? If there were such a command, I would be in business (perhaps this is another feature request). Thanks for the EXCELLENT software.
@neiljackson1984 This would really be 2 different feature requests:
Delete all files, local & remote
The issue with this is that the API does not allow you to remote top level objects via the API, if the item contains children. So, in order to do this, one would have to enumerate every single online item, then, reverse the tree submitting a delete action. This would be extremely time intensive - and not as quick as say just deleting all top level objects.
Right now however, the best solution for you, is go online, via a web browser and delete the objects you wish to delete.
Bug Report Details
Describe the bug Starting with a consumer-grade OneDrive repository that contains several files (although I have observed the same behavior with a SharePoint Online site, and with a OneDrive for Business repository -- the behavior seems to be the same in all three cases), I run the onedrive sync client with the --synchronize and --upload-only command-line options, and specify a syncdir that is a newly-created, empty directory. Based on the description of the --upload-only behavior in the usage guide (https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#performing-a-one-way-upload-sync), I expect the sync client to delete all of the originally-existing files in the OneDrive repository, so as to make the OneDrive repository empty, to match the state of the syncdir. However, what actually happens is that the sync client does not delete any of the existing files in the OneDrive repository.
Application and Operating System Details:
Provide your OS & version (CentOS 6.x, Ubuntu 18.x etc) and the output of:
uname -a
I am running the docker image obtained by doingdocker pull driveone/onedrive:latest
Are you using a headless system (no gui) or with a gui installed? no gui
OneDrive Account Type The log output below is from a run using a consumer-grade OneDrive account, but I have also tested, and observed the same behavior, with a OneDrive for Business repository, and with a document library in a SharePoint Online site.
Did you build from source or install from a package? I am running the docker image obtained by doing "docker pull driveone/onedrive:latest"
OneDrive Application Version: Output of
onedrive --version
OneDrive Application Configuration: Output of
onedrive --display-config
Provide the version of curl you are using: Output of
curl --version
Is your configured 'sync_dir' a local directory or a network mount point? local directory
What partition format type does your configured 'sync_dir' reside on? Output of:
lsblk -f
Explain your entire configuration setup - is the OneDrive folder shared with any other system, shared with any other platform at the same time, is the OneDrive account you use shared across multiple systems / platforms / Operating Systems and in use at the same time. The OneDrive folder is not shared or synced with any other system.
Note: Please generate a full debug log whilst reproducing the issue as per https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support and email to support@mynas.com.au
Complete Verbose Log Output see above