Compare commits

...

2 Commits

Author SHA1 Message Date
5626dc78e6 allow sftp backup
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-27 06:47:09 +02:00
674500b3f9 minio support for restore 2021-01-29 05:54:29 +01:00
2 changed files with 43 additions and 26 deletions

View File

@@ -59,6 +59,23 @@ gpg --batch --trust-model always --enable-progress-filter --output ~/$BACKUP_FIL
rm ~/$BACKUP_FILENAME
echo "uploading"
if [ "$USE_SFTP" -eq 1 ]; then
cd ~/
sshpass -e sftp -oBatchMode=no -b - ${SFTP_USER}@${SFTP_HOST} << !
cd ${SFTP_PATH}
put ${BACKUP_FILENAME}.gpg
bye
!
if [ "$month_day" -eq 1 ] ; then
echo "make monthly backup"
sshpass -e sftp -oBatchMode=no -b - ${SFTP_USER}@${SFTP_HOST} << !
cd ${SFTP_PATH}
cp ${BACKUP_FILENAME}.gpg ${BACKUP_FILENAME_MONTHLY}.gpg
bye
!
fi
rm ~/$BACKUP_FILENAME.gpg
else
AWS_ENDPOINT_OPTION=
AWS_STORAGECLASS_OPTION="--storage-class DEEP_ARCHIVE"
if [ "$AWS_USE_MINIO" -eq 1 ] ; then

View File

@@ -2,15 +2,15 @@
gpg --import /keys/*
aws s3 ls s3://$S3_BUCKET_NAME
echo "These are the files currently available in your backup bucket."
echo "Which file contains the backup you want to restore from?"
echo -n "File name: "
read RESTORE_FILE
AWS_ENDPOINT_OPTION=
if [ "$AWS_USE_MINIO" -eq 1 ] ; then
aws configure set default.s3.signature_version s3v4
AWS_ENDPOINT_OPTION="--endpoint-url https://${MINIO_ENDPOINT}"
fi
cd /restore
aws s3 cp s3://$S3_BUCKET_NAME/$RESTORE_FILE .
aws ${AWS_ENDPOINT_OPTION} s3 cp s3://$S3_BUCKET_NAME/$RESTORE_FILE .
gpg --output ./restore.tar.xz --decrypt $RESTORE_FILE