Thanks for the suggestions.
tee /path/to/where-I-want-logfile-$(date +%Y%m%d-%H%M%S).log did not work.
bash: syntax error near unexpected token `('
I will let you know if the single quote option works.
“Sometimes I think the surest sign that intelligent life exists elsewhere in
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)
----- Dan Rao <[email protected]> wrote:
> You could try:
>
> tee /path/to/where-I-want-logfile-$(date +%Y%m%d-%H%M%S).log
>
> Alternatively, since it doesn't look like you're using any puppet
> variables in the command string, you could try using single quotes
> (i.e. restart => '/path/ ...') so puppet won't try to interpret anything
> it sees in there.
>
>
> Best,
> Dan
>
>
> On 12/15/2011 12:48 PM, Dan White wrote:
> > Here is what I am trying to do:
> >
> > service{ foo:
> > ...
> > restart => "/path/to/script/to/run 2>&1 | tee
> > /path/to/where-I-want-logfile-`date +%Y%m%d-%H%M%S`.log",
> > ...
> > }
> >
> > What I get is a log file named "/path/to/where-I-want-logfile-`date"
> >
> > I have unsuccessfully tried escaping the command quotes with a back-slash.
> > Other than wrapping the while thing in another script, is there any way to
> > fix this ?
> >
> > “Sometimes I think the surest sign that intelligent life exists elsewhere
> > in the universe is that none of it has tried to contact us.”
> > Bill Waterson (Calvin & Hobbes)
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.