Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Pydrive backend is merged now in the development version of duplicity, so better use it from there.

Currently duplicity uses gdocs backend for Google Drive backups. gdocs uses deprecated API and don't allow backups for managed Google accounts. PyDrive backend solves both of those problems.

Install dependecies

apt-get build-dep duplicity
apt-get install python-crypto python-setuptools checkinstall python-lockfile

Generate gpg keys

gpg --gen-key

Create service account in your Google account

openssl pkcs12 -in XXX.p12  -nodes -nocerts > pydriveprivatekey.pem

(you'll need a password you got when created the account)

Download, patch and install duplicity

Download duplicity and signature file


Verify downloaded file

gpg --verify duplicity-0.7.0.tar.gz.sig 

If you don't have duplicity developers' key, i.e. getting this message:

gpg: Signature made Thu 23 Oct 2014 04:19:49 PM IDT using DSA key ID E654E600
gpg: Can't check signature: public key not found

Fetch the key:

gpg --recv-keys E654E600
gpg: requesting key E654E600 from hkp server
gpg: key E654E600: public key "Duplicity Test (no password) <>" imported
gpg: Total number processed: 1
gpg:               imported: 1

Then try to verify again:

gpg --verify duplicity-0.7.0.tar.gz.sig 
gpg: Signature made Thu 23 Oct 2014 04:19:49 PM IDT using DSA key ID E654E600
gpg: Good signature from "Duplicity Test (no password) <>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 9D95 920C ED4A 8D5F 8B08  6A9F 8B6F 8FF4 E654 E600


tar -xzvf duplicity-0.7.0.tar.gz
cd /duplicity-0.7.0

Edit duplicity/ file:

1 Find this:

uses_netloc = ['ftp',
               'scp', 'ssh', 'sftp',
               'webdav', 'webdavs',
               'http', 'https',
               'imap', 'imaps',

And change to this (add "pydrive" to the end of the list):

uses_netloc = ['ftp',
               'scp', 'ssh', 'sftp',
               'webdav', 'webdavs',
               'http', 'https',
               'imap', 'imaps',

2 Find this:

    pu = urlparse.urlparse(url_string)
except Exception:
    raise InvalidBackendURL("Syntax error in: %s" % url_string)

And right after that add:

if pu.query:     
        self.keyfile = urlparse.parse_qs(pu.query)['keyfile']
    except Exception:
        raise InvalidBackendURL("Syntax error (keyfile) in: %s" % url_string)

On the same indent level

Fetch from here and add it to the backends folder:

mv duplicity-0.7.0/duplicity/backends/

Finally, build (as root):

checkinstall python install

Install PyDrive (as root)

apt-get install python-yaml python-simplejson python-pip
checkinstall pip install PyDrive

Use the backend by this remote URL:

duplicity full --encrypt-key *YOUR_gpg_KEY* --sign-key *YOUR_gpg_KEY* /local/folder/path pydrive://


No description, website, or topics provided.



No releases published


No packages published