zoukankan      html  css  js  c++  java
  • [Installation] A substitute solution to using Google Drive in Ubuntu

    Grive2

    Get dependencies

    You need to get the dependency libraries along with their development (-dev or -devel) packages:

    • yajl 2.x
    • libcurl
    • STL (libstdc++)
    • libgcrypt
    • Boost (filesystem, program_options, regex, unit_test_framework and system)
    • expat

    There are also some optional dependencies:

    • CppUnit (for unit tests)
    • libbfd (for backtrace)
    • binutils (for libiberty, required for compilation in OpenSUSE, Ubuntu, Arch and etc)

    And tools:

    • Git
    • CMake
    • C++ compiler (g++ or clang)

    On a Debian/Ubuntu/Linux Mint machine just install the following packages:

    sudo apt-get install git cmake build-essential libgcrypt11-dev libyajl-dev libboost-all-dev libcurl4-openssl-dev libexpat1-dev libcppunit-dev binutils-dev

    Download sources

    CMake

    Now that you are in the source code's “grive2” subdirectory (after 'cd /path/to/yourGriveSourceCodeDir/grive2'), at the prompt type:

    mkdir build
    cd build
    cmake ..
    • note the double period (..) as the argument to cmake, to denote the parent directory.
    • You should get a success message like: ”– Build files have been written to: /your/dir”
    • Don't run it with sudo - root access is not needed for building.

    Make and install

    At the prompt type:

    make -j4

    You'll get lots of messages & hopefully a success message: ”[100%] Built target grive_executable”. The executable file itself (called “grive”) will be placed in the “grive” subdirectory.

    Then install it to the system binary directory (/usr/local/bin by default) by running:

    sudo make install

    Updates

    For subsequent updates, you'll run `git pull` to get the latest source and then just rebuild and re-install it:

    cd /path/to/yourGriveSourceCodeDir/grive2
    git pull
    cd build
    cmake ..
    make -j4
    sudo make install

    Usage

    Backup

    Since grive is still «beta» or «alpha» you should better keep a backup copy of your google directory.

    First run

    Change to your google drive sync directory, and run grive -a:

    cd /home/you/yourGoogleDrive/
    grive -a

     The «-a» option is only needed the very first time you run grive.

    Visit the URL that comes up, then post the auth code given (you must have been logged into Google). You should get some messages including «Synchronizing files» … now you are running.

    Syncs

    To sync, you must run the program manually (there is no «real-time watching» yet). At the prompt, type:

    cd /home/you/yourGoogleDrive/
    grive

    You can set up a cron job, if you want this done on a regular basis.

    Command line options

    Short optionLong optionDescription
    -h --help Produce help message
    -v --version Display Grive version
    -a --auth Request authorization token
    -p arg --path arg Root directory to sync
    -s arg --dir arg Single subdirectory to sync (remembered for next runs)
    -V --verbose Verbose mode. Enable more messages than normal.
      --log-http arg Log all HTTP responses in this file for debugging.
      --new-rev Create new revisions in server for updated files.
    -d --debug Enable debug level messages. Implies -v.
    -l arg --log arg Set log output filename.
    -f --force Force grive to always download a file from Google Drive instead of uploading it.
      --dry-run Only detect which files need to be uploaded/downloaded, without actually performing them.
      --ignore arg Perl RegExp to ignore files (matched against relative paths, remembered for next runs).

  • 相关阅读:
    javascript有用小技巧—实现分栏显示
    在Apk应用程序内,查找某个Activity。
    NodeJS系列~第一个小例子,实现了request.querystring功能
    IOS开发(objective-c)~开篇有理
    爱上MVC3~布局页的继承与扩展
    我心中的核心组件(可插拔的AOP)~第五回 消息组件
    基础才是重中之重~方法override详解
    数据结构 练习 20-查找 算法
    cocos2d-x适配多分辨率
    VS2010中使用CL快速 生成DLL的方法
  • 原文地址:https://www.cnblogs.com/casperwin/p/6209762.html
Copyright © 2011-2022 走看看