Skip to content

Commit

Permalink
expoted env prior running script
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosmicoppai committed May 15, 2024
1 parent c4884ad commit bbae6dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion xbackup/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# It will take backup, compress, encrypt and push it

export PATH="/percona-xtrabackup-8.0.35-30-Linux-x86_64.glibc2.17/bin:$PATH"
. /etc/environments.sh

TARGET_DIR="/xbackup"
FINAL_DIR="$TARGET_DIR/final"
Expand Down
3 changes: 3 additions & 0 deletions xbackup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ echo "${CRON_TIME} bash /usr/local/bin/backup.sh >> /var/log/cron.log 2>&1" > /e
chmod 0644 /etc/cron.d/backup-cron
crontab /etc/cron.d/backup-cron

export PATH="/percona-xtrabackup-8.0.35-30-Linux-x86_64.glibc2.17/bin:$PATH"
printenv | awk -F= '{print "export " $1"=\""$2"\""}' >> /etc/environments.sh

exec cron -f
3 changes: 2 additions & 1 deletion xbackup/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

# It will fetch and decompress the xbackup from the s3

. /etc/environments.sh

S3_TARGET_DIR="xbackup"
TARGET_DIR="/xbackup/recovery"
COMPRESS_EXT=".tar.zst"
LATEST_BACKUP_TXT="latest_backup.txt"

export PATH="/percona-xtrabackup-8.0.35-30-Linux-x86_64.glibc2.17/bin:$PATH"

extract_backup() {
local filename="$1"
Expand Down

0 comments on commit bbae6dc

Please sign in to comment.