Automatic ftp using cron problem
Hello friends,
I got problem using cron. I have created a shell script which is automatically ftp my files to remote server.But when manually I executed same shell script it works fine.When I configure same script in cron it is not working and gave me errors. My Shell script is as follows... ftp -i -n 192.168.10.4 <<EOF user oracle Shekjg34 cd /u05/oralog/starship bin mput *.ARC bye EOF exit 0 I also changed coding of above script as follows... RHOST1=SolidOra12 USER1="oracle" PASSWD1="Shekjg34" ftp -n -i $RHOST1 <<EOF >>/oracle/admin/starship/adhoc/new_ftp/ftp_d.txt user "$USER1" "$PASSWD1" cd /u05/oralog/starship bin mput *.ARC bye EOF exit 0 But each time it gave me following errors.. Login incorrect. Login failed. Please login with USER and PASS. Please login with USER and PASS. Please let me guide to resolve this issue. Thanks in Advance. Regards, Gitesh |
You can try ftp://oracle:Shekjg34@192.168.10.4 to see if it works (some ftp clients work with this URL)
Or use a .netrc in the user that runs the cronjob home directory with the following: Code:
machine 192.168.10.4 |
Hi friend,
Thanks for replying. I cann't find .netrc file in oracle user home.Second thing I want to put more then 1 file also also due to I put ftp -i for noninterective mode.Your said ftp:// can you tell me how can I put -i there? Please give me guidence.I am so much confused. Thanks a lot in Advance. Gitesh |
You have to create the .netrc file since it doesn't exist. And you can use "prompt off" inside your script:
Code:
#!/bin/sh |
Thanks
Hello frinds,
Thanks very much for your valuable help.I have created .netrc in user's $HOME directory and give 600 permission.Now my said script is works fine with cron. Once again thanks a million to you. Regards, Gitesh Trivedi |
All times are GMT -5. The time now is 07:55 PM. |