iwonbigbro/gsync

How do I sync my whole Google Drive?

mhep opened this issue · 3 comments

mhep commented

I have so far only been able to sync my local folders with certain folders on my Google Drive, with commands such as:

gsync -c -r -t -p -o -g -v --progress --delete -l -s google/Backups/ drive:///Backups

What command would I use to sync the whole folder google with my Google Drive?

Thanks!

Have you tried:

gsync -c -r -t -p -o -g -v --progress --delete -l -s google/ drive:///

When I run that I get an error:

DEBUG: ValueError(u'Invalid path: drive:',): File "/usr/lib/python2.6/site-packages/libgsync/crawler.py", line 150, in run
self._walk(srcpath, self._walkCallback, self._dev)
File "/usr/lib/python2.6/site-packages/libgsync/crawler.py", line 124, in _walk
self._sync(f)
File "/usr/lib/python2.6/site-packages/libgsync/sync/init.py", line 31, in call
self._sync(path)
File "/usr/lib/python2.6/site-packages/libgsync/sync/init.py", line 188, in _sync
self.dst.create(dstPath, srcFile)
File "/usr/lib/python2.6/site-packages/libgsync/sync/file/init.py", line 316, in create
self.createFile(path, srcObj)
File "/usr/lib/python2.6/site-packages/libgsync/sync/file/__init
.py", line 219, in createFile
self._updateFile(path, src)
File "/usr/lib/python2.6/site-packages/libgsync/sync/file/local/__init
.py", line 141, in _updateFile
uploader = src.getUploader()
File "/usr/lib/python2.6/site-packages/libgsync/sync/file/remote/init.py", line 47, in getUploader
f = drive.open(path, "r")
File "/usr/lib/python2.6/site-packages/libgsync/drive/init.py", line 608, in open
return DriveFileObject(path, mode)
File "/usr/lib/python2.6/site-packages/libgsync/drive/init.py", line 82, in init
self._parentInfo = self._drive.stat(dirname)
File "/usr/lib/python2.6/site-packages/libgsync/drive/init.py", line 458, in stat
self.validatepath(path)
File "/usr/lib/python2.6/site-packages/libgsync/drive/init.py", line 420, in validatepath
raise ValueError("Invalid path: %s" % path)

Error: ValueError(u'Invalid path: drive:',)

I get the same error, but only when going from remote to local. This works:

gsync -c -r -t -p -o -g -v -P -l -s Drive drive://

This does not:

gsync -c -r -t -p -o -g -v -P -l -s drive:// Drive

generating

Warning: Not running as root, file ownership may be ignored
Penetration Test FY1718
DEBUG: ValueError(u'Invalid path: drive:',):   File "/home/ser/.local/lib/python2.7/site-packages/libgsync/crawler.py", line 150, in run
    self._walk(srcpath, self._walkCallback, self._dev)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/crawler.py", line 124, in _walk
    self._sync(f)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/sync/__init__.py", line 31, in __call__
    self._sync(path)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/sync/__init__.py", line 188, in _sync
    self.dst.create(dstPath, srcFile)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/sync/file/__init__.py", line 316, in create
    self.__createFile(path, srcObj)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/sync/file/__init__.py", line 219, in __createFile
    self._updateFile(path, src)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/sync/file/local/__init__.py", line 141, in _updateFile
    uploader = src.getUploader()
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/sync/file/remote/__init__.py", line 47, in getUploader
    f = drive.open(path, "r")
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/drive/__init__.py", line 608, in open
    return DriveFileObject(path, mode)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/drive/__init__.py", line 82, in __init__
    self._parentInfo = self._drive.stat(dirname)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/drive/__init__.py", line 458, in stat
    self.validatepath(path)
  File "/home/ser/.local/lib/python2.7/site-packages/libgsync/drive/__init__.py", line 420, in validatepath
    raise ValueError("Invalid path: %s" % path)

Error: ValueError(u'Invalid path: drive:',)
sent 0 bytes  received 0 bytes  0.00 bytes/sec

Curiously, this error only appears after gsync has retrieved at least one of the files in the remote directory; it prints out the name of the first file (Penetration Test FY1718), and then dumps.

Linux sting 4.10.13-1-ARCH #1 SMP PREEMPT Thu Apr 27 12:15:09 CEST 2017 x86_64 GNU/Linux
gsync version 0.1.14