how to redirect verbose to file?

m.roth at 5-cent.us m.roth at 5-cent.us
Wed Apr 28 19:55:51 UTC 2010


Anne,

Anne wrote:
> I'm struggling with this problem. I have a cron job that runs down a list
> of files being backed up. It's called "bp_backupme.pl". As it's backing up,
> (in verbose -v mode), it outputs a list of files being backed up.
>
> Does anyone know how I would redirect that files output into a file? (I
> tried the >> filename.xt or >filename.txt, but it doesn't work.)
>
> The script runs like this: /opt/bp_backupme.pl -v
>
> I tried the: /opt/bp_backupme.pl -v  > filename.txt
>
> But, it just errors out. If I just run the script normally, everything
> runs smoothly and it lists the files on the screen.
>
> Any idea how to grab that file list into a file?

Yep. It's being written to STDERR, not STDOUT. To get that, use
/opt/bp_backupme.pl -v > filename.txt 2>&1

      mark




More information about the redhat-list mailing list