VS: Re: how to redirect verbose to file?

Tatu Salin tatusalin at hotmail.com
Thu Apr 29 07:39:36 UTC 2010


Have you tried put in the crontab file something like * * * * * yourfile.pl >> /path/outputfile.txt This should write output file to the file. Each time when yourfile.pl runs it should write to the end of that file the output. not 100% sure if that helps and works, but hopefully this helps. There might be still need to add 2&>1 on the front of path, but not hundred procent sure if that works. Kind regards TS


-----Original Message-----
From: Cameron Simpson
Sent: 4/29/2010 2:52:56 AM
To: General Red Hat Linux discussion list
Subject: Re: how to redirect verbose to file?
On 28Apr2010 15:55, m.roth at 5-cent.us <m.roth at 5-cent.us> wrote:
| 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

Or just a plain:

  2>filename.txt

withoput mucking with stdout at all.

Cheers,
--
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Here's a great .sig I wrote, so good it doesn't rhyme.
        Jon Benger <jbenger at agravaine.st.nepean.uws.edu.au>

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



More information about the redhat-list mailing list