moves files remotely using ftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting moves files remotely using ftp
# 1  
Old 04-01-2010
moves files remotely using ftp

Hi All,
How can i move files from one directory to another in remote server using ftp?

Thanks in Advance,
# 2  
Old 04-01-2010
Without knowing anything about your Operating Systems or ftp software the best guess is to look at the ftp "rename" command. On my machine the command does not take wildcards but it does take full pathnames.


Code:
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /var/tmp
250 CWD command successful.
ftp> rename /var/tmp/myfile /tmp/myfile
350 File exists, ready for destination name.
250 RNTO command successful.
ftp> cd /tmp
250 CWD command successful.
ftp> dir myfile
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
-rw-r--r--   1 myuser       mygroup              0 Apr  1 15:08 myfile
226 Transfer complete.

# 3  
Old 04-01-2010
Hi,
Thanks for your reply.
I tried the below command and it worked for 1 file. But i am unable to move multiple files (say 1000 files) to another directory through "rename" command. Is there any way i can move multiple files?
# 4  
Old 04-01-2010
You'll need to use ftp "dir" to get a list of files back to your local server, then use this list to compose a long list of "rename" commands for your ftp script.
# 5  
Old 04-01-2010
Hi,
through dir i got the list of filenames in the specified directory. But now how to use rename command to move 1000 files from one directory to other directory using remote server?

Thank you,
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies

2. UNIX for Dummies Questions & Answers

Remotely Diff Two files

Daily Stupid Question: How can I remotely look at the difference from a file from my localhost and a remote machine? So: diff local-file remote-file-on-some-other-ip (2 Replies)
Discussion started by: metallica1973
2 Replies

3. Shell Programming and Scripting

How to wite shell script to moves files?

Greetings to all, i am new to shell scripting. i need to wite a script that moves files after renaming them to .txt . The exact scenario is this. i have a directory /stsarie/btms/v5.0/report/wps where files will be imported from Host system periodically. Along with a file say named... (2 Replies)
Discussion started by: latrom77
2 Replies

4. Shell Programming and Scripting

sftp script - problem removing files remotely

Hello all, After searching through the similar topics and not finding a working solution, I decided to join and post my question (and maybe kill time and help other users). Essentially I am trying to get a file from the sftp and then delete it after the file is pulled. all the sftp commands... (3 Replies)
Discussion started by: MarcMaiden
3 Replies

5. Shell Programming and Scripting

moves checkout files to local system

I am using my script which generally checkout the repository.Is there any coomand which can help me to checkout the repository not on that svn server while it moves it to your local system at the desired location. (0 Replies)
Discussion started by: rohit22hamirpur
0 Replies

6. Filesystems, Disks and Memory

Not able to FTP the files to a FTP server

Hi , We are facing a weird problem in our project. we need to send some xml & audio files to a remote FTP server from a Linux box, we are doing this in Perl script using Net::FTP->. Issue here is.. when FTPed the files using Perl scripts, only empty files ( 0 byte) are getting created on the... (2 Replies)
Discussion started by: kishorepotta
2 Replies

7. Shell Programming and Scripting

Script that moves itself

Hello all, I'm new here, so if this is in the wrong place please feel free to move it. :) As a challenge to myself, I've decided I want to make a "alive" script. Well not really, but almost. I want to make a script that will rove around my hard drive in the background (actually "moving"... (2 Replies)
Discussion started by: chmod
2 Replies
Login or Register to Ask a Question