Werner Beroux b7d18ab0af Update README.md
Reformat the code.
2016-01-22 21:15:48 +01:00
2016-01-22 16:36:16 +01:00
2016-01-22 15:23:03 +01:00
2016-01-22 21:15:48 +01:00

Dockerized duplicity backup tool.

Features of this Docker image:

  • Small: Built using alpine.
  • Simple: Most common cases are explained below and require minimal setup.
  • Secure: Runs as any user (so pic any random UID or run as your user which avoids to run as root which isn't the safest).

Usage

Backup to Google Cloud Storage example

Google Cloud Storage nearline costs about $0.01/GB/Month.

Set up:

  1. Sign up, create an empty project, enable billing, and create a bucket
  2. Under "Storage" section > "Interoperability" tab > click "Enable interoperable access" and then "Create a new key" button and note both Access Key and Secret. Also note your Project Number (aka project ID, it's a number like 1233457890).
  3. Run gcloud's gsutil config -a to generate the ~/.boto configuration file and give it all these info (alternatively you should be able to set environment variable GS_ACCESS_KEY_ID and GS_SECRET_ACCESS_KEY however in my tries I didn't see where to set your project ID).

You should now have a ~/.boto looking like:

[Credentials]
gs_access_key_id = MYGOOGLEACCESSKEY
gs_secret_access_key = SomeVeryLongAccessKeyXXXXXXXX

[GSUtil]
default_project_id = 1233457890

Now you're ready to perform a backup:

$ docker run --rm --user $UID \
      -e PASSPHRASE=P4ssw0rd \
      -v /:/data:ro \
      -v ~/.boto:/home/duplicity/.boto:ro \
      wernight/duplicity \
      duplicity /data gs://my-bucket-name/some_dir

To restore, you'll need:

  • Keep keys or regenerate them to access your Google Cloud Storage.
  • The PASSPHRASE you've used.

See also the note on Google Cloud Storage.

Backup to Google Drive example

Google Drive offers 15GB for free.

Set up:

  1. Follow notes on Pydrive Backend to generate a P12 credential file (call it pydriveprivatekey.p12) and note also the associated service account email generated (e.g. duplicity@developer.gserviceaccount.com).

  2. Convert P12 to PEM:

    $ docker run --rm -i --user $UID \
          -v $PWD/pydriveprivatekey.p12:/pydriveprivatekey.p12:ro \
          wernight/duplicity \
          openssl pkcs12 -in /pydriveprivatekey.p12 -nodes -nocerts >pydriveprivatekey.pem
    Enter Import Password: notasecret
    

Now you're ready to perform a backup:

$ docker run --rm --user $UID \
      -e PASSPHRASE=P4ssw0rd \
      -e GOOGLE_DRIVE_ACCOUNT_KEY=$(cat pydriveprivatekey.pem) \
      -v /:/data:ro \
      wernight/duplicity \
      duplicity /data pydrive://duplicity@developer.gserviceaccount.com/some_dir

To restore, you'll need:

  • Regenerate a PEM file (or keep it somewhere).
  • The PASSPHRASE you've used.

Backup via rsync example

TODO

More help

See also duplicity man page and you can also do:

$ docker run --rm wernight/duplicity duplicity --help

Feedbacks

Report issues/questions/feature requests on GitHub Issues.

Description
No description provided
Readme 66 KiB
Languages
Dockerfile 92.5%
Shell 7.5%