Google Drive Sync Tool based on NodeJS and the Google Drive API
Requirements:
- nodejs (v7.10.1)
- npm
Download the repository and install all dependencies
git clone https://github.com/DrauzJu/gdrive-sync.git
cd gdrive-sync
npm i
You can configure which Google Drive folders should be synchronized with which local directories.
To do so, for every folder mapping create a .yaml file in the configuration directory.
The configuration directory could be specified with the parameter --confDir
(default gdrive-sync/configs
).
The following yaml attributes could be used:
remotePath
: the path on your google drive storagelocalPath
: the path to the local directorydirection
: in which direction files should be synchronized:downloadOnly
: only downloads remote changesbidirectional
: download & upload of files (not yet supported!)
deleteLocal
: whether local files should be delete if they are deleted on google drive (true
/false
)
A sample configuration file can be found in the repository (configs/sample.yaml
).
node gdrive-sync/.
Optional parameters:
--confDir directory
: specify the directory where to find the config files (defaultgdrive-sync/configs
)--clear-cache
: Clears the cache before starting the synchronisation
On the first run (or after clearing the cache) you will be asked for authorization to access your google drive account. Open the displayed link in a browser, follow the instructions and copy/paste the authorization token.