I didn't want this solution to get lost in the void. It was provided to me by Ralf Weinedel.
> Hallo Jason, > > I found your e-mail address on the webpage > http://wiki.edseek.com/howto:dirvish and want to report a new experience > that I made. > I use dirvish 1.2.1 backup successfully since 2006 running debian and > nowadays ubuntu. Do to server changes i need to extend my pre/post scripts > and need to use the dirvsh environment variables > (DIRVISH_SERVER|_CLIENT|_SRC ...) but recognized that they aren't available > inside the pre/post scripts (except DIRVISH_EXCLUDE). > > I'm not a perl professional, but after inserting some debugging output I > saw that dirvish calls an external shell by > > /bin/sh -c 'cd /var/backup/<vault>/20111228-3/tree; DIRVISH_SERVER=horus > DIRVISH_CLIENT=horus DIRVISH_SRC= > DIRVISH_DEST=/var/backup/<vault>/20111228-3/tree > DIRVISH_IMAGE=<vault>:default:20111228-3 DIRVISH_STATUS=success ; > /etc/dirvish/pre-server' > > Ubuntu uses dash for default 'sh' and the call must _export_ the > environment variables to be available inside the scripts. As a workaround I > changed the sub scriptrun in dirvish (around line 942) > > if ($A{dir} !~ /^:/) > { > #$rcmd = sprintf ("%s 'cd %s; %s %s' >>%s", > $rcmd = sprintf ("%s 'cd %s; export %s %s' >>%s", > ("$A{shell}" || "/bin/sh -c"), > $A{dir}, $A{env}, > $cmd, > $A{log} > ); > } else { > #$rcmd = sprintf ("%s '%s %s' >>%s", > $rcmd = sprintf ("%s 'export %s %s' >>%s", > ("$A{shell}" || "/bin/sh -c"), > $A{env}, > $cmd, > $A{log} > ); > } > > => > /bin/sh -c 'cd /var/backup/<vault>/20111228-3/tree; export > DIRVISH_SERVER=horus DIRVISH_CLIENT=horus DIRVISH_SRC=a > DIRVISH_DEST=/var/backup/<vault>/20111228-3/tree > DIRVISH_IMAGE=<vault>:default:20111228-3 DIRVISH_STATUS=success ; > /etc/dirvish/pre-server' > > Now the call function properly as designed ;-) I was wondering that no one > else have had this problem. Dirvish was installed from the original ubuntu > package (dirvish 1.2.1-1.1). Perhaps you can use this hint on the website. > > > -- Thursday next week is indeed time for a thorough insight into the swirling red debian vortex. — leeta
_______________________________________________ Dirvish mailing list [email protected] http://www.dirvish.org/mailman/listinfo/dirvish
