fetch command sending STDOUT to STDERR
Peter Elsner
peter at servplex.com
Fri Aug 1 13:54:39 PDT 2003
For some time now, I've been using FTP to transfer files from one
server to another. I recently decided to update my script to use fetch
instead of FTP.
For some reason, the fetch command seems to be sending STDOUT
messages to STDERR.
I have a cron job that runs every 15 minutes and fetches some files,
the output from STDIN is:
96 bytes transferred in 0.0 seconds (1.24 MBps)
249 bytes transferred in 0.0 seconds (2.70 MBps)
However, I have the STDOUT redirected to a file name in /tmp report.out
and STDERR redirected to a file name in /tmp report.err
My script then checks to see if report.err is greater than 0 bytes.
If it's not, the script exits cleanly (it should), if it is greater than 0
bytes,
it sends me an email stating that the file transfer failed, and appends the
report.err file.
Here is my cron entry:
*/15 * * * * /home/reports/reports.sh >/tmp/reports.out 2>/tmp/reports.err
For the time being, I've redirected STDERR to /dev/null which will stop
the problem. However, if the transfer fails, I won't know about it either...
Is this normal for fetch?
Peter
Peter Elsner <peter at servplex.com>
Vice President Of Customer Service (And System Administrator)
1835 S. Carrier Parkway
Grand Prairie, Texas 75051
(972) 263-2080 - Voice
(972) 263-2082 - Fax
(972) 489-4838 - Cell Phone
More information about the freebsd-hackers
mailing list