Wrap up B2 setup
This commit is contained in:
parent
c353f45612
commit
f1ee132038
@ -7,4 +7,4 @@ B2_BUCKET="loki-backup"
|
||||
|
||||
# GPG key (last 8 characters)
|
||||
GPG_KEY="{{ gpg_key_id }}"
|
||||
PASSPHRASE="{{ gpg_passphrase }}"
|
||||
GPG_PASSPHRASE="{{ gpg_passphrase }}"
|
||||
|
@ -97,6 +97,10 @@
|
||||
apt:
|
||||
name: duplicity
|
||||
|
||||
- name: Install B2 backend for duplicity
|
||||
pip:
|
||||
name: b2
|
||||
|
||||
- name: Create GitLab credentials file
|
||||
template:
|
||||
src: ./gitlab.cred.j2
|
||||
|
@ -13,4 +13,4 @@
|
||||
|
||||
tasks:
|
||||
- name: Install python2
|
||||
raw: apt-get -y install python
|
||||
raw: apt-get -y install python python-pip python-setuptools
|
||||
|
@ -9,6 +9,11 @@ export PASSPHRASE=${GPG_PASSPHRASE}
|
||||
# Local directory to backup
|
||||
LOCAL_DIR="/media/usb0/backup"
|
||||
|
||||
# Remove files older than 30 days
|
||||
duplicity remove-older-than 30D --force \
|
||||
--encrypt-sign-key $GPG_KEY \
|
||||
b2://${B2_ACCOUNT}:${B2_KEY}@${B2_BUCKET}
|
||||
|
||||
# Perform a full backup
|
||||
duplicity full \
|
||||
--encrypt-sign-key $GPG_KEY \
|
||||
|
Reference in New Issue
Block a user