Skip to content

Commit

Permalink
fix(backup.sh): remove S3 variable and fix folder mismatch (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Maillot <[email protected]>
  • Loading branch information
vmaillot authored Mar 1, 2024
1 parent e0ed54e commit 8668c18
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

set -xeuo pipefail

OCP_BACKUP_S3=""

# check storage type
if [ "${OCP_BACKUP_S3}" = "true" ]; then
# prepare & push backup to S3
Expand All @@ -47,13 +45,12 @@ if [ "${OCP_BACKUP_S3}" = "true" ]; then

# make dirname
BACKUP_FOLDER="$( date "${OCP_BACKUP_DIRNAME}")" || { echo "Invalid backup.dirname" && exit 1; }
BACKUP_PATH="$( realpath -m "${OCP_BACKUP_SUBDIR}/${BACKUP_FOLDER}" )"

# make necessary directory
mkdir -p "/host/var/tmp/etcd-backup"
mkdir -p "/host/var/tmp/etcd-backup/${BACKUP_FOLDER}"

# create backup to temporary location
chroot /host /usr/local/bin/cluster-backup.sh /var/tmp/etcd-backup
chroot /host /usr/local/bin/cluster-backup.sh "/var/tmp/etcd-backup/${BACKUP_FOLDER}"

# move files to S3 and delete temporary files
mcli mv /host/var/tmp/etcd-backup/* "${OCP_BACKUP_S3_NAME}"/"${OCP_BACKUP_S3_BUCKET}"
Expand Down

0 comments on commit 8668c18

Please sign in to comment.