ftp files from local sys to unix server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ftp files from local sys to unix server
# 1  
Old 08-24-2011
ftp files from local sys to unix server

Hi All,

can anybody explain me how to ftp files from local system to unix server using Shell scripting without using any softwares.
i have developed some code but its not wrking.
Code:
lclpath=/dba58/d039/ftppubd/ajay
echo $lclpath
cd $lclpath
user='rajesh'
pswd='rajesh'
host="3.209.136.253"
ftp_path="D:\Others\back2school"
ftp -v -n $host << EOF
user $user $pswd
lcd $ftp_path
get raji.txt
bye
EOF
echo "FTP DONE"

the above code not working...
if any help will appreciate.

regards
rajesh

Moderator's Comments:
Mod Comment Please use code tags, thanks.

Last edited by zaxxon; 08-24-2011 at 10:39 AM.. Reason: code tags
# 2  
Old 08-24-2011
When you have a problem, try to describe it exactly, thanks. What error message do you get?
# 3  
Old 08-24-2011
Thank you for your reply zaxxon.
I didn't get any error and its hanging while executing..
don't know the mistake in the script.

Regards
Rajesh
# 4  
Old 08-24-2011
At which point/command is it hanging?
When you try the commands manually exactly as they are in the script, does this work?
# 5  
Old 08-26-2011
after lcd its hanging..
can you please check it..?
# 6  
Old 08-26-2011
rajesh, shouldn't you be using put instead of the get, if you are sending a file across?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

FTP-ing files from Windows server to UNIX server

I need to transfer files from a Windows server to the Unix server and have to run some shell script on it to get the required output. Is it possible to transfer files from Windows server to unix server through any shell script? If so can you please help me with the details. Thanks in... (8 Replies)
Discussion started by: ssk250
8 Replies

2. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

3. UNIX for Dummies Questions & Answers

Copying files from Unix Server to Local

How to copy files from Unix server to Local (6 Replies)
Discussion started by: win4luv
6 Replies

4. UNIX for Dummies Questions & Answers

Copying files from Unix Server to Local

How do i copy files from Unix Server to my Local Desktop.. ANy ideas..please suggest....V Urgent. (1 Reply)
Discussion started by: win4luv
1 Replies

5. Shell Programming and Scripting

script for to take files from FTP server to UNIX server and Unzipped that files

script for to take files from FTP server to UNIX server and Unzipped that files (1 Reply)
Discussion started by: sunilamarnadh
1 Replies

6. AIX

Do I need to configure my local windows to FTP files from local windows to a UNIX AIX server?

Hi Friends, I have this script for ftping files from AIX server to local windows xp. #!/bin/sh HOST='localsystem.net' USER='myid_onlocal' PASSWD='mypwd_onlocal' FILE='file.txt' ##This is a file on server(AIX) ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies

7. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

8. Shell Programming and Scripting

how to FTP a file from the local folder to unix server

Hi All, please help me to write a shell that ftp a file which is in the local (C:\) drive to a Unix server. Where as i know the IP for the Unix server. i could do this process by using ftp command. pls help me to write as Shell script. Thanks in advance for all of your answers.:b::b: (3 Replies)
Discussion started by: little_wonder
3 Replies

9. Shell Programming and Scripting

Dowloading a File from FTP Server to a local Server where User Id's are different

Hi, The Setup is like this. I'm connecting to Unix machine from my local machine. After connecting to Unix M/c, i need to connect FTP server. Am successful in connecting to FTP server, but am not able to download the file from the ftp server to my local machine. I have different user id's and... (1 Reply)
Discussion started by: ranjith_taurean
1 Replies

10. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies
Login or Register to Ask a Question