Re: Stracing Amanda (was: RSDL for 2.6.21-rc3- 0.29)

Nish Aravamudan
2007-03-13T03:01:19Z

On 3/12/07, Gene Heskett <gene.heskett@gmail.com> wrote:
> On Monday 12 March 2007, Douglas McNaught wrote:
> >Patrick Mau <mau@oscar.ping.de> writes:
> >> Why not temporarly replace "/bin/tar" with a shell script that does:
> >>
> >> #!/bin/sh
> >> exec strace -f -o output /bin/real.tar $@
> >
> >You beat me to it. :) I've done that before; it's a great suggestion.
> >
> >Except that if you expect 'tar' to be invoked multiple times in a run,
> >you should probably use 'output.$$' for the output filename so things
> >don't get clobbered.
> >
> >-Doug
>
> In my case, Doug, it will get invoked 64 times, amanda does a dummy run to
> get an estimate, calculates what to do based on that output which is 32
> runs, 1 per disklist entry and I have 32, and then reruns tar with the
> appropriate level options against each individual disklist entry.
>
> But I'm puzzled a bit, what does the double $$ do?, or it buried someplace
> in the bash manpage? Its not something I've stumbled over yet.

buried indeed:

"Special Parameters:
...
$ Expands to the process ID of the shell. In a () subshell, it
expands to the process ID of the current shell, not the sub‐
shell.
"

Thanks,
Nish