#3330 Issue closed
: Why ReaR does not make important vars available as env vars for PRE/POST_BACKUP_SCRIPT ?¶
Labels: support / question
, fixed / solved / done
jirib opened issue at 2024-10-15 14:12:¶
ReaR 27a, the latest one, on SLES 15.5.
Since output dir is created with 700 permission, I was testing for a
customer POST_BACKUP_SCRIPT
a workaround to change permissions for
data in output dir (let's ignore that worl-readable is bad here).
Using (set -o posix; set)
in my POST_BACKUP_SCRIPT
I found out that
important ReaR variables are not available inside my script (eg.
PXE_CONFIG_URL, BACKUP_URL etc...).
I workaround that passing the ReaR vars as argument to my script but IMO having them available by default would be much more helpful.
Any thoughts, comments? Thank you.
jsmeix commented at 2024-10-16 13:07:¶
Works for me with
(excerpts from my etc/rear/local.conf on a test VM with rear27a)
BACKUP_URL=file:///other/
POST_BACKUP_SCRIPT=( 'echo $BACKUP_URL >/tmp/POST_BACKUP_SCRIPT.stdout' )
After "rear mkbackup" I got
# cat /tmp/POST_BACKUP_SCRIPT.stdout
file:///other/
jsmeix commented at 2024-10-16 13:09:¶
To explicity export specific variables
you may call export
as needed in etc/rear/local.conf
because etc/rear/local.conf is executed as a bash script
via source
, cf. the comment in the current
https://github.com/rear/rear/blob/master/etc/rear/local.conf
jsmeix commented at 2024-11-08 15:02:¶
I assume it is sufficiently answered because "no news is good news".
(If not, reopen it with continuative information.)
[Export of Github issue for rear/rear.]