Gdrive: Getting error `Root directoy is not empty, the initial sync requires an empty directory`

Created on 19 Jun 2016  路  8Comments  路  Source: prasmussen/gdrive

I am trying to sync a local directory with a non-empty directory on Drive.

I am executing the following command for doing so:

gdrive sync upload /path/to/local/dir <drive-directory-id>

but am getting the error Root directoy is not empty, the initial sync requires an empty directory (there's a typo in it by the way).

Is there any workaround for this? I don't want to re-upload multiple GB's of data.

Most helpful comment

I found a manual workaround, create the new directory via gdrive mkdir, then move/rename the directory to desired location and try the sync upload again. It worked it for me.

All 8 comments

The same problem here. Also because of this error, a folder can not proper shared with other developers. As if I create a folder on drive synced, the other developer in my team can not use sync function to edit the folder anymore.

+1, the same problem.
Sync upload should be continue what the GUI created. Re-index of data by gdrive should be normal.

+1, the same problem.
Why does sync upload need an empty directory in the first place? No rationale given for this in the source.

+1, the same problem.
I uploaded many gigabytes of data into a folder on Google Drive and then wanted to sync new files after they were added to the local folder, but I got this error.

I found a manual workaround, create the new directory via gdrive mkdir, then move/rename the directory to desired location and try the sync upload again. It worked it for me.

+1, the same problem.

This is just a major design failure, right?

What's the point of syncing if you can only sync into an empty directoy [sic]?

Stupid as it is, @transbetty's workaround works. Create an empty dummy directory, start syncing, then immediately move everything from the original directory into the dummy, and rename the dummy to the original.

Very easy. Ext:
My local path: _/home/data/movie_
Now, I login my GDrive and make new folder home, access home and make folder data, access data and make folder movie, and copy GDrive ID folder move => new path GDrive: _/home/data/movie_
Finally, i use command line start sync local -> GDrive

./gdrive -c gdrive-config sync upload /home/data/movie [ID folder movie]

Good luck!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChrisMann89 picture ChrisMann89  路  5Comments

skyuuka picture skyuuka  路  4Comments

dominion66 picture dominion66  路  4Comments

divamgupta picture divamgupta  路  5Comments

GaryFurash picture GaryFurash  路  3Comments