Nautilus – Why is Nautilus so slow in copying files to Google Drive?

google-drivenautilussync

I was trying to copy a directory from a local drive to Google Drive using Nautilus. But Nautilus is showing that it needs 596,523 hours. Also, there no apparent progress in copying. When I used Google Drive itself (folder upload), it is suggesting a time something like 24 hours.

Why is there such a substantial difference in the time required? And what can be done to solve the problem?

Best Answer

I am answering my own question based on the comments from the kind readers. Using the directions in the pages pointed to plus a few others, I have devised a framework that is working fine after a few tweaks.

The Framework Summary

  • Mount your Google Drive on Linux with google-drive-ocamlfuse.
  • Use rsync to copy files and directories.

Framework Setup Details

  • Install and setup google-drive-ocamlfuse. In a terminal window, run,

    sudo add-apt-repository ppa:alessandro-strada/ppa &&\ 
    sudo apt update && sudo apt install google-drive-ocamlfuse
    

.

  • Authorize google-drive-ocamlfuse so it will have access to your Google account. In the terminal window and issue the command google-drive-ocamlfuse. This command will open a browser window that will either prompt you to log into your Google account or if you're already logged in, ask you to allow google-drive-ocamlfuse access to your Google account. If you've not logged in, do so and then click Allow. The next window will ask you to grant permission for both gdfuse and OAuth2 Endpoint to access your Google account. Click Allow again. The next browser screen will inform you to wait until the authorization tokens have downloaded. When your terminal prompt returns with the message, “Access token retrieved correctly”, you know the tokens have been downloaded, and you're ready to mount.

  • Mount your Google Drive. Create a directory (e.g. google-drive) to serve as the mount point (in subsequent discussions we are going to term this as either the source or destination directory, whichever applicable for you). From the terminal, issue the command,mkdir ~/google-drive, to create a new directory in your home directory. Issue the command google-drive-ocamlfuse ~/google-drive to mount your Google Drive to the google-drive directory.

  • At this point, you should see your Google Drive files/directories populate in the google-drive directory. You can work with Google Drive as if it were a local directory system.

  • When you want to unmount the google-drive directory, issue the command fusermount -u ~/google-drive.

More on the previous steps can be found here.

  • Now you can start copying your files and directories using any GUI or command line methodology you like. But I found rsync to be especially suited for the purpose. I found the following command suitable (and optimized) for my case.
rsync -uvrt --progress --human-readable <source directory/>\
<destination directory/>

A Few Words about rsync

rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. One of the important features of rsync is that it works on “delta transfer algorithm”, which means it will only sync or copy the changes from source to the destination instead of copying the whole file which ultimately reduce the amount of data sent over the network. Please see the man page for rsync or this page for details.

rsync can be stopped (terminated) anytime and rsync will resume from that point at the next invocation. Please see this question (and answers) for other helpful hints.

Related Question