Skip to content

Commit bbae6dc

Browse files
committed
expoted env prior running script
1 parent c4884ad commit bbae6dc

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

xbackup/backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

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

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

1010
TARGET_DIR="/xbackup"
1111
FINAL_DIR="$TARGET_DIR/final"

xbackup/entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,7 @@ echo "${CRON_TIME} bash /usr/local/bin/backup.sh >> /var/log/cron.log 2>&1" > /e
5151
chmod 0644 /etc/cron.d/backup-cron
5252
crontab /etc/cron.d/backup-cron
5353

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

xbackup/prepare.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
# It will fetch and decompress the xbackup from the s3
44

5+
. /etc/environments.sh
6+
57
S3_TARGET_DIR="xbackup"
68
TARGET_DIR="/xbackup/recovery"
79
COMPRESS_EXT=".tar.zst"
810
LATEST_BACKUP_TXT="latest_backup.txt"
911

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

1213
extract_backup() {
1314
local filename="$1"

0 commit comments

Comments
 (0)