Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 21-04-2005, 06:23 PM   #1 (permalink)
Apprentice
 
Join Date: Jan 2005
Location: Chennai
Posts: 64
Default FTP Server- Question-Help me


Hello friends
I have some problem in my project.
I connect to a ftp server [PARTICULAR DIRECTORY IN THAT SERVER].
i have to download all the files from that directory to a specified directory in my local machine.

The Problem is , in order to check for status of the transfer. I need to know the file count [No of files in the FTP server].
If i know the count of files in the FTP server, then i can use that information for checking the number of files downloaded to my local directory .
This makes us confirm whether there was a successful transfer of all files.
How To Find Num of files in FTP Server directory in a FTP Session.


2. After transfer i have to move the files in FTP server from one directory to another.
say in ftp server i have directory called source , from where i mget all the files
after transfer i have to move those files to archive directory present in the FTP server itself.

Can we write mv command there in ftp session..

3. I connect to FTP from unix box [ using .netrc information]
Please help me on this
karthik_rcs is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 21-04-2005, 06:36 PM   #2 (permalink)
In The Zone
 
ferrarif50's Avatar
 
Join Date: May 2004
Posts: 221
Default

I can answer your second question.

U need to do some shell scripting here.

Transfer all the files to a local temp folder and then retransfer it back to the FTP server.

U can automate this whole process using a shell script

#beg of file
#!/bin/sh
ftp -i -n <<HERE
open $1
user $2 $3
mget $3/*.*
close
quit

ftp -i -n <<HERE
open $1
user $2 $3
mput $4/*.*
close
quit

#end of file


Here $1 $2 and $3 are the ip address, username and pwd. $3 and $4 are the directories in the FTP server.

Hope this helps you.
__________________
My time machine will take you one hour into the future in only sixty minutes!
ferrarif50 is offline  
Old 21-04-2005, 10:47 PM   #3 (permalink)
Apprentice
 
Join Date: Jan 2005
Location: Chennai
Posts: 64
Default REply: prblem

thanks ferrari,
but how to find the number of files in the ftp server directory.
is there any way to find out that.?
thanks in advance
please help me.
karthik_rcs is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by clmlbx
- by ico
- by clinton
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2