duply backups to Google Drive for less than £2 a month

As of writing this google Drive prices are quite affordable and with the demise of  Crashplan for home I’ve been looking for alternatives.

so, over the next few weeks I’ll be abusing google drive as a backup.

Screen shot of google prices
Google Drive prices

Create A profile

firstly create a profile with

duply googlebackup create

Create an API token

visit https://console.developers.google.com/ and create an Client ID

client ID > Other
it will look something like this
sdfsodsafindafoaidsfdosihfh8sdf8s.apps.googleusercontent.com
and a secret key
3204uujfw9e0hw8ef9f_er3

pop these two values in to your gdrive file.

cat ~/.duply/googlebackup/gdrive

client_config_backend: settings
client_config:
client_id: <secret google ID here>
client_secret: <secret key here>
save_credentials: True
save_credentials_backend: file
save_credentials_file: gdrive.cache
get_refresh_token: True

 

these are the important part of the config file

cat ~/.duply/googlebackup/config
GPG_KEY='GPG KEY ID HERE'
GPG_PW='Password here'


GPG_OPTS='--compress-algo=bzip2 --bzip2-compress-level=9'

export GOOGLE_DRIVE_SETTINGS = gdrive

TARGET='pydrive://<USERNAME>@gmail.com/Backup'


SOURCE='/home/dthomas'

FILENAME='.duplicity-ignore'
DUPL_PARAMS="$DUPL_PARAMS --exclude-if-present '$FILENAME'"

MAX_AGE=1M

MAX_FULL_BACKUPS=2

MAX_FULLS_WITH_INCRS=2
MAX_FULLBKP_AGE=1M
DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE "

VOLSIZE=100
DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE "

# verbosity of output (error 0, warning 1-2, notice 3-4, info 5-8, debug 9)
# default is 4, if not set
VERBOSITY=5

 

and ofcourse add any folders you wish to ignore.

cat ~/.duply/googlebackup/exculde

# although called exclude, this file is actually a globbing file list
# duplicity accepts some globbing patterns, even including ones here
# here is an example, this incl. only 'dir/bar' except it's subfolder 'foo'
# - dir/bar/foo
# + dir/bar
# - **
# for more details see duplicity manpage, section File Selection
# http://duplicity.nongnu.org/duplicity.1.html#sect9


- /home/dthomas/Music
- /home/dthomas/Bin
- /home/dthomas/Devel
- /home/dthomas/Games
- /home/dthomas/Videos
- /home/dthomas/Documents/ISOs
- /home/dthomas/Downloads
+ /home/dthomas
- **

this is the important part of the bashrc file

cat .bashrc

...
export GOOGLE_DRIVE_SETTINGS='/home/dthomas/.duply/googleDrive/gdrive'
...

then run with

duply googlebackup backup

this can be run manually or by adding it to your users crontab

Leave a Reply