<p><em>更新2016/04/25:</em></p>
<p>与python2-oauth2client 2.00的不兼容性在duplicy0.7.07.1中已经修复(参见<a href="http://duplicity.nongnu.org/CHANGELOG" rel="nofollow noreferrer">changelog</a>)。我刚刚在Linux系统上测试了一下,它运行得非常好。在</p>
<p><em>原文如下:</em></p>
<p>首先,检查python2-oauth2client版本。在编写这个2.00版本时,它似乎还不能起到表里不一的作用。我不得不降到1.5.2才能让它重新工作。在</p>
<p>第二,确保不同的python版本(OSX内置版本与自制软件包、手动安装版本与pip版本等)没有冲突。这可能是个好主意。在</p>
<p>确保PyThird驱动器配置完成。以下是如何使用“普通”谷歌用户帐户的简要说明:</p>
<h2>步骤1:创建pydrive后端配置文件</h2>
<p>在某处创建一个pydrive配置文件(例如<code>/etc/duply/pydrive.conf</code>或<code>~/etc/pydrive.conf</code>),其中包含以下内容:</p>
<pre><code>client_config_backend: settings
client_config:
client_id: <client-id-string>.apps.googleusercontent.com
client_secret: <client-secret-string>
save_credentials: True
save_credentials_backend: file
save_credentials_file: </path/to/save/authdata.json>
get_refresh_token: True
</code></pre>
<ul>
<li><p>启用<a href="https://console.developers.google.com/apis/api/drive/overview" rel="nofollow noreferrer">Google Drive API</a>后,可以从<a href="https://console.developers.google.com" rel="nofollow noreferrer">Google Developers Console</a>的API管理器获取客户端id和客户端机密。</p></li>
<li><p>将<em>save_credentials_file</em>设置到pydrive成功连接后可以缓存身份验证数据的任意位置(例如<code>/etc/duply/pydrive.json</code>或<code>~/etc/pydrive.json</code>)。</p></li>
</ul>
<h2>第二步:告诉duplicity在哪里找到它</h2>
<p>这是通过设置<em>GOOGLE_DRIVE_SETTINGS</em>shell变量来完成的:</p>
^{pr2}$
<p>{cd5>你可能需要自动添加所有会话。在</p>
<h2>第三步:第一次认证</h2>
<p>引自Duplicy手册页:</p>
<blockquote>
<p>During the first run, you will be prompted to visit an URL in your
browser to grant access to your drive. Once granted, you will receive
a verification code to paste back into Duplicity. The credentials are
then cached in the file references above for future use.</p>
</blockquote>
<p>。。。你就完蛋了。在</p>
<h2>故障排除</h2>
<p>如果这仍然不起作用,请检查文件权限:对于上面指定的配置文件,运行duplicity的用户是否有足够的权限?在</p>