Adapts restic backend in examples + updates restic + adds a check script
This commit is contained in:
parent
ecf177a191
commit
ecab420648
|
@ -48,6 +48,7 @@
|
|||
loop:
|
||||
- backup.sh
|
||||
- restore.sh
|
||||
- check.sh
|
||||
|
||||
- name: Create log folder
|
||||
ansible.builtin.file:
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Set crypto passphrase for encryption
|
||||
export AWS_ACCESS_KEY_ID={{ backup_config.access_key }}
|
||||
export AWS_SECRET_ACCESS_KEY={{ backup_config.secret_key }}
|
||||
export RESTIC_PASSWORD={{ backup_config.restic_key }}
|
||||
export RESTIC_REPOSITORY={{ backup_config.restic_target }}
|
||||
restic="/opt/restic/restic"
|
||||
dir_prefix="/backup/dbs"
|
||||
|
||||
# Write beginning date to backup log
|
||||
echo 'Check date' $(date)'.'
|
||||
echo ' '
|
||||
|
||||
$restic cat config
|
||||
$restic check
|
||||
|
||||
# Write end to log file
|
||||
echo ' '
|
||||
echo '============================'
|
||||
echo ' '
|
||||
|
||||
# Unset ENVs
|
||||
unset AWS_ACCESS_KEY_ID
|
||||
unset AWS_SECRET_ACCESS_KEY
|
||||
unset RESTIC_PASSWORD
|
||||
unset RESTIC_REPOSITORY
|
|
@ -4,8 +4,8 @@
|
|||
# Backup configuration
|
||||
#
|
||||
|
||||
restic_version: "0.15.1"
|
||||
restic_target: "s3:https://s3.TODO.com/BUCKET"
|
||||
restic_version: "0.15.2"
|
||||
restic_target: "rest:https://$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY@restic.TODO.com/$AWS_ACCESS_KEY_ID/BUCKET"
|
||||
restic_key: "TODO"
|
||||
access_key: "TODO"
|
||||
secret_key: "TODO"
|
||||
|
|
Loading…
Reference in New Issue