|
From: Craig B. <cba...@us...> - 2006-04-28 07:12:53
|
"Rein" writes:
> This is likely due to me not speaking Perl, but what's the best way to=20
> achieve <subj>?
>=20
> Here's how it works for me now -- is there a better way?
>=20
> I'm using an expect script to shut the computer down after the backup=20
> completes, but I don't want the output of that script to end up in the=20
> transfer log, because it contains the password.
>=20
> For some reason expect's own "fork ... disconnect" routine doesn't work=
=20
> when BackupPC executes the script as DumpPostUserCmd.
>=20
> Setting
> $Conf{DumpPostUserCmd} =3D 'shutd.sh $host > /dev/null';
>=20
> didn't work also -- the '> /dev/null' part is passed as an argument to t=
he=20
> 'shutd.sh' script.
>=20
> So right now I'm using a wrapper script that takes the hostname as an=20
> argument and calls the original expect script, directing it's output to=
=20
> /dev/null.
To improve security, BackupPC doesn't use a shell to execute commands
- it forks and execs the commands directly. So any shell constructs,
like redirection, don't work. Your approach of using a wrapper shell
script it the right one.
Craig
|