Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload Only Option that does not perform remote delete #49

Closed
gustiarto opened this issue Jul 4, 2018 · 10 comments
Closed

Upload Only Option that does not perform remote delete #49

gustiarto opened this issue Jul 4, 2018 · 10 comments

Comments

@gustiarto
Copy link

I can't use "onedrive --upload-only" in command-line, showing error =

--synchronize or --monitor missing from your command options or use --help for further assistance

No OneDrive sync will be performed without either of these two arguments being present

Then i use "onedrive -m --upload-only"
When "1.zip" was uploaded on my OneDrive account, then i delete "1.zip" in local (~/OneDrive)
But at once uploading "2.zip", even "1.zip" has gone on my OneDrive account.

I think causes i use "-m" option but i can't be performed without "-m" option
How can i use Upload-Only Option without sync remote from local ?

@abraunegg
Copy link
Owner

Generally, unless you want to do a bi-directional sync that constantly runs, do not use monitor mode.

How can i use Upload-Only Option without sync remote from local ?

You need to use the following command:

onedrive --synchronize --upload-only

For further command options, refer to:

onedrive --help

@gustiarto
Copy link
Author

Nope, i use command:

onedrive --synchronize --upload-only
Still cant solve my problem

I make cron job for my web server

  1. zip web file
  2. upload that file to onedrive
  3. delete file that file
    Because my storage of webserver so tiny, i wont to save the backup zip on that server.

"I want to "upload only" like on web-access of OneDrive, so when local file has been removed, on OneDrive not deleted". Like just for store the backup.
Because after upload complete, i deleted the file. My local hardisk so tiny.

@abraunegg
Copy link
Owner

Because after upload complete, i deleted the file. My local hardisk so tiny.

The way that the client works (currently) is that it replicates the local / remote state. If a file is deleted locally or remotely, that state will be reflected.

So essentially what your looking for is the following:

onedrive --synchronize --upload-only --no-remote-delete

However --no-remote-delete is not an option at present - thus I don't have a 'full' solution for you at present.

@abraunegg abraunegg reopened this Jul 4, 2018
@abraunegg abraunegg changed the title Upload Only Option Upload Only Option that does not perform remote delete Jul 4, 2018
@diman82
Copy link

diman82 commented Aug 1, 2018

@abraunegg Any estimations when this feature might be added?

@abraunegg
Copy link
Owner

@diman82
This actually has an active branch locally where I was working on this before a few bug related issues raised which take priority. Once they are closed off & merged, I will be looking at this again. Time frame ~ 1 week I would say pending no bug issues raised.

abraunegg added a commit that referenced this issue Aug 1, 2018
* Implement --no-remote-delete so that local deletes are not processed to delete the coresponding file on OneDrive when using --upload-only
@abraunegg
Copy link
Owner

abraunegg commented Aug 1, 2018

@diman82, @gustiarto

Please can you help test PR #96

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/96/head:pr96
git checkout pr96
make
make install

Local testing of this PR below:

./onedrive --synchronize --verbose --upload-only --no-remote-delete
Loading config ...
Using Config Dir: /root/.config/onedrive
No config file found, using defaults
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /root/OneDrive
Initializing the Synchronization Engine ...
Account Type: personal
Default Drive ID: <redacted>
Default Root ID: <redacted>
Remaining Free Space: 5364645376
Fetching details for OneDrive Root
OneDrive Root exists in the database
Syncing changes from local path only - NOT syncing data changes from OneDrive ...
Uploading differences of .
Processing root
The directory has not changed
Processing myfile.txt
The file has been deleted locally
Skipping remote delete as --upload-only & --no-remote-delete configured
Uploading new items of .
Skipping item - invalid symbolic link: ./link1

Validated that file still remains on OneDrive after local delete.

@abraunegg abraunegg added In Progress Currently being worked on Fixed and removed Future Work - Planning Required In Progress Currently being worked on labels Aug 1, 2018
@abraunegg
Copy link
Owner

@diman82, @gustiarto
Any update from your side?

@diman82
Copy link

diman82 commented Aug 4, 2018

@abraunegg Seems to be working as expected!

ubuntu@ip-172-31-44-197:/mnt/data/transmission/completed$ onedrive --synchronize --upload-only --no-remote-delete --upload-only --destination-directory Movies --verbose

Loading config ...
Using Config Dir: /home/ubuntu/.config/onedrive
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /mnt/data/transmission/completed/
Initializing the Synchronization Engine ...
Account Type: business
Default Drive ID: b!oK34j0_s7ECzhM69EVarJmJ84iWNmYdPip2E6eQXOOfEKaWw6M1nRb7c1XwYkQzn
Default Root ID: 015UARYDN6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 4804976087207
Fetching details for OneDrive Root
OneDrive Root exists in the database
Syncing changes from local path only - NOT syncing data changes from OneDrive ...
Uploading differences of .
Processing root
The directory has not changed
Processing Видеокурс по ремонту ноутбуков от PC Expert. Бесплатно._Full-HD.mp4
The file has not changed
Uploading new items of .
OneDrive Client requested to create remote path: ./Lynda - Microsoft SQL Server 2016 Essential Tr
aining
The requested directory to create was not found on OneDrive - creating remote directory: ./Lynda
- Microsoft SQL Server 2016 Essential Training
Successfully created the remote directory ./Lynda - Microsoft SQL Server 2016 Essential Training
on OneDrive
OneDrive Client requested to create remote path: ./Lynda - Microsoft SQL Server 2016 Essential Tr
aining/Exercice Files
The requested directory to create was not found on OneDrive - creating remote directory: ./Lynda
- Microsoft SQL Server 2016 Essential Training/Exercice Files
Successfully created the remote directory ./Lynda - Microsoft SQL Server 2016 Essential Training/
Exercice Files on OneDrive
Uploading file ./Lynda - Microsoft SQL Server 2016 Essential Training/Exercice Files/Ex_Files_SQL
_Server2016_EssT.zip ...
Uploading fragment: 0-7259/7259
Remaining free space: 4804416774552
 done.
Remaining free space: 4804416774552

abraunegg added a commit that referenced this issue Aug 5, 2018
…emote delete (Issue #49) (#96)

* Implement Feature Request: Upload Only Option that does not perform remote deletes
@abraunegg
Copy link
Owner

Merged PR #96

@lock
Copy link

lock bot commented Jan 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jan 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants