Syncing one file at a time using the CLI

This is in Windows 7.

I downloaded the CLI and successfully with the first line. I would guess this is a one-time entry for this line?
Then, I entered the 2nd “sync” line and I got a message in the CMD window that said I needed the Odrive app running first, so I started it.
The Odrive app started and started automatically downloading files from all over the sync folders, so I stopped the automatic download.
Then, I ran the 2nd “sync” line again and nothing happened.
So, I turned automatic sync back on and then it started pulling the files from the intended folder, but it also started pulling many files from other folders. It definitely isn’t transferring one file at a time.

So, this isn’t working right.

Thanks,
Eric

Hi @eric.koester,
Did you previously set any folder sync rules that said to always have files in folders synced? That may be what’s kicking in when you turn on automatic sync.
For reference: https://docs.odrive.com/docs/sync-source-changes#section-configure-folder-sync-rules

The first command is only needed once, just to download the CLI tools.

Can you run the second command again and take a screenshot of the command + output?

I do have some folders set with sync rules - from right-clicking on the folder and telling it to sync with recursive folders from then on.
If that’s the problem, I don’t know how to change those settings, once they are set.

I just set the auto download setting to “never download”, but dowloads from other folders keep restarting themselves.
Do I need to quit the odrive app after I change the auto download setting to “never download” and then restart it, and then run the command line sync command again?

There has no output after entering the 2nd sync line.
All that happens: a new command prompt appears with a blinking cursor.
Should there be output messages?

Hi @eric.koester,
I would expect some output. I would only expect no output if there were no .cloud files in the folder you are choosing to sync. Can you post the command you are running (or PM me if you don’t want to post here), so I can take a look?

Can you also send a diagnostic from the odrive menu?

For resetting sync rules on all folders, try this:

  1. Right-click on the root “odrive” folder and select “Sync”
  2. Slide the Slider all the way to “Nothing”
  3. Leave “Include Subfolders” unchecked
  4. Check “Save and apply to new files and folders”
  5. Click the sync button

Hi @eric.koester,
I split this off into a new thread. I also saw your PM and replied there. Can you take a look?

I tried this on the odrive root folder and it let me do it.

  1. Right-click on the root “odrive” folder and select “Sync”
  2. Slide the Slider all the way to “Nothing”
  3. Leave “Include Subfolders” unchecked
  4. Check “Save and apply to new files and folders”
  5. Click the sync button

But, then foldders I right-clicked on and selected Stop, start syncing again!

I just clicked the Send diagnostics button as requested.

Hi @eric.koester,
I am waiting for the diagnostic to come in. It may take a while if you have a large local data repository.

I wanted to make sure that the files you see syncing are downloads and not uploads, though. odrive will always try to upload files that need to be uploaded. Folder sync rules won’t affect uploads and issuing a stop on a folder that is uploading files will just start again (the stop is only for downloads).

After resetting the sync rules, try restarting the desktop client and see if any files start downloading on their own again. Please also send another diagnostic since I haven’t seen this one come in yet…

I am mainly downloading files in recovery from the “Amazon Cloud Drive erasure of my local drive” event.
This is a MESS.

I am trying to prevent the big big files from downloading right now, because they never finish, just keep restarting. Since they never finish, they are just wasting bandwidth and delaying the smaller files that will download successfully.

Can you add an upload icon to be applied to files are are uploading and then users can see which are uploading and which are downloading?
As-is, there is only a magenta sync icon, and users can’t tell if it’s uploading or downloading.

Hi @eric.koester,
The diagnostic came through.

There are about 1000 items in the waiting queue, which is probably why you are seeing things continuing to sync. A restart should clear this out so that the script can be the only one issuing the download requests, one at a time.

To make sure of this you can restart, turn off automatic sync, and then run the script.

Do you mean to restart only the odrive app or restart Windows 7 too?

I just restarted the odrive app, opened a cmd window, issued the sync command line and files from other folders started syncing again.
How can I see if they are uploads or downloads?

Hi @eric.koester,
I meant restart the app.

Steps:

  1. Restart odrive
  2. Turn off auto-sync from the odrive menu
  3. Run through the folder rules reset steps one more time (See Syncing one file at a time using the CLI)
  4. Run the script
  5. Send a diagnostic after a few minutes

As for seeing uploads vs downloads, the CLI can actually give us lots of information, including active uploads or downloads.

For general status:

powershell -command "& {$comm_bin=\"$HOME\.odrive\common\bin\";$o_cli_bin=\"$comm_bin\odrive.exe\";$(& \"$o_cli_bin\" status);}"

Then you can get detailed status on specific areas with these commands:

powershell -command "& {$comm_bin=\"$HOME\.odrive\common\bin\";$o_cli_bin=\"$comm_bin\odrive.exe\";$(& \"$o_cli_bin\" status --uploads);}"

powershell -command "& {$comm_bin=\"$HOME\.odrive\common\bin\";$o_cli_bin=\"$comm_bin\odrive.exe\";$(& \"$o_cli_bin\" status --downloads);}"

powershell -command "& {$comm_bin=\"$HOME\.odrive\common\bin\";$o_cli_bin=\"$comm_bin\odrive.exe\";$(& \"$o_cli_bin\" status --trash);}"

powershell -command "& {$comm_bin=\"$HOME\.odrive\common\bin\";$o_cli_bin=\"$comm_bin\odrive.exe\";$(& \"$o_cli_bin\" status --waiting);}"

powershell -command "& {$comm_bin=\"$HOME\.odrive\common\bin\";$o_cli_bin=\"$comm_bin\odrive.exe\";$(& \"$o_cli_bin\" status --not_allowed);}"

I just used the command lines you sent.
The other files from the other directories, are uploads, so all is working as expected.

I’ve been trying to rebuild my local directories with any backups I have here in the house.
Sometimes, Amazon Cloud and Odrive don’t see the files as the same on both ends, and so my locally reloaded file gets uploaded to Amazon Cloud.

It would be great if some of this command line status functionality could make it into the Windows application!

Thanks for your help.
Eric

Does this command line have any bandwidth limits encoded in it?

powershell -command "& {$syncpath=\"H:\odrive\Amazon Cloud Drive\Pictures\";$syncbin=\"$HOME\.odrive\common\bin\odrive.exe\";while ((Get-ChildItem $syncpath -Filter \"*.cloud*\" -Recurse | Measure-Object).Count){Get-ChildItem -Path \"$syncpath\" -Filter \"*.cloud*\" -Recurse | % {echo \"Syncing $($_.FullName)\"; & \"$syncbin\" \"sync\" \"$($_.FullName)\";}}echo \"No more files/folders to sync\"}"

I noted that when I used it, I got a 1Mbit download stream of data.
When I opened a 2nd concurrent CMD window and entered another command line, I then saw about 2Mbit of total download stream.
It appears that each of these commands yeilds a 1Mbit download stream?

Hi @eric.koester,
I’ve found that Amazon Drive tends to behave this way for single-file downloads. I generally get a mediocre rate of download, but adding more concurrency multiplies it (to a point). You can run multiple commands to create concurrency. You may see some errors when one hits a files that is already being downloaded or was downloaded, but it should continue on.