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 (last 8 characters)
|
||||||
GPG_KEY="{{ gpg_key_id }}"
|
GPG_KEY="{{ gpg_key_id }}"
|
||||||
PASSPHRASE="{{ gpg_passphrase }}"
|
GPG_PASSPHRASE="{{ gpg_passphrase }}"
|
||||||
|
@ -97,6 +97,10 @@
|
|||||||
apt:
|
apt:
|
||||||
name: duplicity
|
name: duplicity
|
||||||
|
|
||||||
|
- name: Install B2 backend for duplicity
|
||||||
|
pip:
|
||||||
|
name: b2
|
||||||
|
|
||||||
- name: Create GitLab credentials file
|
- name: Create GitLab credentials file
|
||||||
template:
|
template:
|
||||||
src: ./gitlab.cred.j2
|
src: ./gitlab.cred.j2
|
||||||
|
@ -13,4 +13,4 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Install python2
|
- 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 directory to backup
|
||||||
LOCAL_DIR="/media/usb0/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
|
# Perform a full backup
|
||||||
duplicity full \
|
duplicity full \
|
||||||
--encrypt-sign-key $GPG_KEY \
|
--encrypt-sign-key $GPG_KEY \
|
||||||
|
Reference in New Issue
Block a user