29 lines
674 B
Bash
Raw Normal View History

2023-02-27 22:39:25 +01:00
#!/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