git clone https://github.com/kbinani/gdsync.git
cd gdsync
bundle install
The first time you upload to/download from Google Drive, gdsync will prompt authentication message like this:
1. Open this page:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=788008427451-1h3lt65qc87afhcm1fvh1h3gliut5ivq.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/drive%20https://spreadsheets.google.com/feeds/
2. Enter the authorization code shown in the page:
You have to open the web page and follow the instruction by Google. Then paste authentication code. The autentication code will be stored to config.json
under the project root directory.
gdsync
has a subset of rsync(1)
options. Supported rsync
options are:
-v, --verbose increase verbosity
-c, --checksum skip based on checksum, not mod-time & size
-a, --archive archive mode; same as -rt
-r, --recursive recurse into directories
-u, --update skip files that are newer on the receiver
-d, --dirs transfer directories without recursing
-t, --times preserve time
-n, --dry-run show what would have been transferred
--existing skip creating new files on receiver
--ignore-existing skip updating files that exist on receiver
--remove-source-files sender removes synchronized files (non-dir)
--delete delete extraneous files from dest dirs
--max-size=SIZE don't transfer any file larger than SIZE
--min-size=SIZE don't transfer any file smaller than SIZE
-I, --ignore-times don't skip files that match size and time
--size-only skip files that match in size
ruby gdsync.rb --archive /path/to/source/dir/ googledrive://path/to/destination/dir
ruby gdsync.rb --archive googledrive://path/to/source/dir/ /path/to/destination/dir
ruby gdsync.rb --archive googledrive://path/to/soruce/dir/ googledrive://path/to/destination/dir
It is possible to sync between local directories with gdsync, but rsync is better choice in this case.
The MIT License
@kbinani
gdsync
comes with ABSOLUTELY NO WARRANTY.