configure #2

Merged
v4l3n71n merged 23 commits from configure into master 2023-02-27 21:53:18 +00:00
2 changed files with 35 additions and 3 deletions
Showing only changes of commit 3b8652a97a - Show all commits

View File

@ -0,0 +1,29 @@
#!/bin/bash
if [ $# -lt 3 ]; then
echo -e "Usage $0 <scw_configrc> <time or delta> [file to restore] <restore to>
Exemple:
\t$ $0 2018-7-21 recovery/ ## recovers * from closest backup to date
\t$ $0 0D secret data/ ## recovers most recent file nammed 'secret'";
exit; fi
source $1
shift
if [ $# -eq 2 ]; then
duplicity \
--s3-endpoint-url ${SCW_ENDPOINT_URL} \
--s3-region-name ${SCW_REGION} \
--time $1 \
${SCW_BUCKET} $2
fi
if [ $# -eq 3 ]; then
duplicity \
--s3-endpoint-url ${SCW_ENDPOINT_URL} \
--s3-region-name ${SCW_REGION} \
--time $1 \
--file-to-restore $2 \
${SCW_BUCKET} $3
fi

View File

@ -12,11 +12,14 @@
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: Copy scw backup script
- name: Copy scw backup and restore script
copy:
src: "scw-backup.sh"
dest: "/opt/scw-backup.sh"
src: "{{ item }}"
dest: "/opt/{{ item }}"
mode: "0500"
with_items:
- "scw-backup.sh"
- "scw-restore.sh"
vars:
ansible_become: yes
ansible_become_method: sudo