gdrive icon indicating copy to clipboard operation
gdrive copied to clipboard

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

Open Anmol-Singh-Jaggi opened this issue 9 years ago • 9 comments

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.

Anmol-Singh-Jaggi avatar Jun 19 '16 20:06 Anmol-Singh-Jaggi

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.

DHOscar avatar Jul 07 '16 13:07 DHOscar

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

4SiB avatar Aug 04 '16 23:08 4SiB

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

bramkuijper avatar Sep 15 '16 10:09 bramkuijper

+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.

daparker avatar Sep 26 '16 20:09 daparker

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.

transbetty avatar Oct 30 '16 16:10 transbetty

+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]?

ThunderRoad75 avatar Jun 05 '17 19:06 ThunderRoad75

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.

ThunderRoad75 avatar Jun 05 '17 20:06 ThunderRoad75

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!

SystemTN avatar Mar 07 '18 07:03 SystemTN

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.

I dont understand. That feels like gdrive upload -r (recursively) to a new dummy directory and then rename the dummy folder to the original folder... That will take the time of uploading an entire folder to gdrive..

yangyxt avatar Jul 25 '22 14:07 yangyxt