Red Hat Enterprise Linux WS release 3 (Taroon Update 9)
I have a FTP job where I use .netrc. I have a shell script also. When I run the shell script I get the output log file with the FTP details but when I run it from a crontab job, I get only;
Interactive mode off.
Local directory now /home/nasdrnap/extracts/files
If I run the Shell script, I get (and this is what I want to get);
Connected to 198.18.18.51.
220 FTPSERV1 Microsoft FTP Service (Version 5.0).
500 'AUTH GSSAPI': command not understood
500 'AUTH KERBEROS_V4': command not understood
331 Password required for ftpuser1.
230 User ftpuser1 logged in.
prompt
Interactive mode off.
lcd /home/nasdrnap/extracts/files
Local directory now /home/nasdrnap/extracts/files
cd /PRA/Client_out
250 CWD command successful.
put Reports.txt
local: Reports.txt remote: Reports.txt
227 Entering Passive Mode (198.18.18.51,19,75).
125 Data connection already open; Transfer starting.
226 Transfer complete.
190059 bytes sent in 0.027 seconds (7e+03 Kbytes/s)
put filesent.trg
local: filesent.trg remote: filesent.trg
227 Entering Passive Mode (198.18.18.51,19,76).
125 Data connection already open; Transfer starting.
226 Transfer complete.
94 bytes sent in 2.9e-05 seconds (3.2e+03 Kbytes/s)
quit
221
----------------My Shell Script----------------------
su - db2inst1 "-c /home/db2inst1/scripts/Creport.sh"
cd /home/nasdrnap/extracts/files/archive
rm Reports.txt
cp /home/nasdrnap/extracts/files/Reports.txt .
ftp 198.18.18.51 | tee /root/ReportsFtp.log
----------------My .netrc file----------------------------
machine 198.18.18.51
login ftpuser1
password MU74N%IH
macdef init
prompt
lcd /home/nasdrnap/extracts/files
cd /PRA/Client_out
put Reports.txt
put filesent.trg
quit
--------------My crontab entry is-------------------
00 21 * * 1,2,3,4,5 /root/CLNTReport.sh
-------------------------------------------------
How can I get the same output in the log file (ReportsFtp.log) after running from the crontab ?
Thanks for any help.
Mike