Operating System - HP-UX
1834921 Members
2853 Online
110071 Solutions
New Discussion

Re: FTP results send to root's email

 
SOLVED
Go to solution
MAD_2
Super Advisor

FTP results send to root's email

I have a script that FTPs some files archive files to another server. The problem I have is that it sends a very long list of these files and the entire FTP process gets recorded in root's email. I do not want it to go there, can anyone tell me what I can add to avoid this from happening (like how to send it to /dev/null?):

FTP portion of the script.
++++++++++++++++++++++++++++++++++++++++++


#FTP the compressed archives
echo "`date` Start FTP of Oracle archive files to ${HOST1} " >> ${LOGFILE}
ftp -n ${HOST1} <<-EOF
user ${USER} ${PASS}
cd ${RMTARCHDIR}
binary
verbose
mput arch*gz
bye
EOF

++++++++++++++++++++++++++++++++++++++++++

Thanks for any help!
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
3 REPLIES 3
Mic V.
Esteemed Contributor

Re: FTP results send to root's email

Maybe:

ftp -n ${HOST} <<-EOF >/dev/null 2>&1

Mic
What kind of a name is 'Wolverine'?
Sridhar Bhaskarla
Honored Contributor
Solution

Re: FTP results send to root's email

Hi,

You can take out "verbose" from your ftp commands.

You can also redirect the output messages to /dev/null as below. Here both stdout and stderr go to /dev/null. But you can adjust it to however you want.

ftp -n ${HOST1} << EOF > /dev/null 2>&1
..
..
EOF

To redirect standard out messages to a log file but errors to /dev/null

ftp -n ${HOST1} << EOF >> $LOGFILE 2>/dev/null

The other way

ftp -n ${HOST1} << EOF > /dev/null 2>$LOGFILE


-Sri

Should work

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
MAD_2
Super Advisor

Re: FTP results send to root's email

Great, thank you both!
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with