Skip to content

A python tools to sync files in local directory to google drive.

Notifications You must be signed in to change notification settings

socrateslee/gdrivesync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gdrivesync

A simple python tools to sync files in a local directory to Google Drive directory.

##usage Please register a Google api key for access Drive API, and

python -c gdrivesync.py config_file.json [dir_name1[, dir_name2[, ...]]]

The confie_file.json should be a json file like

{"client_secret": "YOUR_CLIENT_SECRET",
 "client_id": "YOUR_CLIENT_ID"}

Each of dir_name* is a local directory to sync, for specify the sync beheavior, there should be a .gdrivesync file contained in the directory. For example:

{"exclude": [".gdrivesync"],
 "include": ["*.txt", "*.md"],
 "remote_dir": "gdrive-sync",
 "remote_id": "GOOGLE_DRIVE_FOLDER_ID"}

The meanning of keys in .gdrivesync files are:

  • remote_id The id of your target folder in google drive, your files will be sync to this folder.
  • remote_dir If no remote_id provided, the tools will try find the id of this folder in your google drive.
  • include If provided, only files matched specified patterns will be synced.
  • exclude If provided, files matched specified patterns will be removed. Note that the tools will adopt include first, exclude after.

About

A python tools to sync files in local directory to google drive.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages