OneDrive sync/download issues

I am having the same issue, but I am syncing ODP, not business.

Hi @jmtudor,
Can you send a diagnostic from the odrive menu?

Is the behavior the same as above where you can browse via the odrive web client fine, but have issues uploading? Are you unable to do anything via the desktop client?

I just forwarded.

Below may be off topic, or related, but I continue to experience synchronization issues. I have about 1TB of data stored on OneDrive personal, synchronizing to my work PC and home PC. The issue is that there are many files that don’t sync unless I manually click on them. I am at work as I write this, and my work PC shows about 550Gb of data. I manually right click the root folder, select sync, and this morning it synched about 30Gb and then just stopped synchronizing. The only way I knew it stopped is I would right click and do the properties to see total usage. The file/folder count stays the same which is good. I just started the manual sync again and got the following popup (which may be unrelated or a different issue:
“Can’t sync OneDrivePersonal.
The file is locked on OneDrive.”

I’m not sure what file is locked, or what to do about it.

The tray icon is idle. I have it set up to download everything, unlimited bandwidth, etc.

Any help appreciated.

As to your questions:
Is the behavior the same as above where you can browse via the odrive web client fine, but have issues uploading?
I can browse odrive web client. The files are on the web client, and a marker/placeholder is on my PC hard drive, but the files are not synchronized, so they haven’t downloaded to my work PC. THe issue here is I have a similar situation at home PC, but I don’t know which files have not been uploaded to oDrive from home and then downloaded to my work PC. oDrive is supposed to manage all that for me. It’s not so bad because I can double click at either location (Home or Work) and retrieve the file. But the big problem is that I have another utility that backs up my hard drive, and if the file markers (.cloud) have no data, my backup does not get those files backed up. In addition, I’m not sure what happens if the files get out of sync with multiple changes.

Are you unable to do anything via the desktop client? Desktop client works fine. It’s just not synchronizing all the files in both directions, either at home or at work.

Hi @jmtudor,
I split this off to a new topic because it seems like a different issue.

I took a look at the diagnostics and I can see a few errors that OneDrive is giving back. The “Locked” error is an “Access Denied” error coming from OneDrive. It is possible its a temporary issue on their side.

If your primary use case here is keeping things all local, a simple script running as a scheduled task may work better. The problem with a bulk download operation (right-click->sync on a folder) is that it can stop if it hits enough exceptions or certain types of exceptions. With a script, we can have it just go until it is done, regardless of how many errors are hit along the way. I believe you may have actually used a similar method in the past, but this will be a bit different.

The first step is to make sure the CLI is installed. You may already have this, but just in case:

Open up a command prompt by clicking on the Windows icon in the taskbar, typing “cmd”, and then clicking on “Command Prompt”.

Once the command prompt is open, copy and paste the following command in (all one line) and hit enter. This will install the CLI for us to use in the next command:

powershell -command "& {$comm_bin=\"$HOME\.odrive\common\bin\";$o_cli_bin=\"$comm_bin\odrive.exe\";(New-Object System.Net.WebClient).DownloadFile(\"https://dl.odrive.com/odrivecli-win\", \"$comm_bin\oc.zip\");$shl=new-object -com shell.application; $shl.namespace(\"$comm_bin\").copyhere($shl.namespace(\"$comm_bin\oc.zip\").items(),0x10);del \"$comm_bin\oc.zip\";}"

The next step is to setup a scheduled task to run a sync command every day (or however often you want it to run) to download everything in the specified folder.
Copy and run this command in the command prompt

schtasks /create /tn "_My hourly odrive sync job_" /sc hourly /tr "powershell" & mmc "C:\Windows\system32\taskschd.msc" /s

This is going to create a template hourly scheduled task and then open the scheduled task management screen.

Double-click on the new task, select the “Actions” tab, then click on “Edit”:

In the following screen, copy and paste the command below into the “Add arguments (optional)” text box:

-command "& {$syncpath=\"D:\odrive\OneDrivePersonal\";$syncbin=\"$HOME\.odrive\common\bin\odrive.exe\";while ((Get-ChildItem $syncpath -Filter \"*.cloud*\" -Recurse | Measure-Object).Count){Get-ChildItem -Path \"$syncpath\" -Filter \"*.cloud*\" -Recurse | % {& \"$syncbin\" \"sync\" \"$($_.FullName)\";}}}"

This command is going to sync the entire OneDrive folder (assuming it is named “OneDrivePersonal”, as you have). If you want a specific folder inside OneDrive, you will add that to the path (OneDrivePersonal\Data).

Click “OK” on all of the hanging windows and you are done. You can right-click on the new task and select “Run” to run the task immediately to test.

The command line returned an error:
’$o’ is not recognized as an internal or external command,
operable program or batch file.

Whoops… sorry about that @jmtudor . I posted the command for a powershell window instead of a command window. I’ve corrected it now.

I also adjust the other command for the scheduled task, accordingly.

This worked but copying the screens, which were slightly different than yours in cases others use your scripts. My “Actions” tab did not show the “Edit” button that your screen showed. Instead, in the right section I chose “Properties”, then chose the “Actions” tab to get to your “Edit Action” box.

Thank you!

I am unable to edit the Conditions and some other settings, it asks for my password and doesn’t accept anything I give it. In searching the web, it appears this may be related to me not being the author of the script? I am logged in as an administrator.

When I changed to radio button back to “Run only when user is logged on” it accepted my changes without asking for password. I selected “Run” and it appears to be working.

Great! Thanks for the update @jmtudor. Mine was also set to run only when logged it, but it was done by default so I didn’t need to explicitly change it.