Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-19-2005, 01:32 PM
|
#1
|
Member
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207
Rep:
|
Mirror an FTP site.
I need to mirror the file contents of an FTP site but the only access method is FTP (not SSH.) Currently I have an expect script that automates the download process via ncftp (which can copy whole directories automatically.) The script is rather dumb though since I have to manually terminate once all the files complete. Expect doesn't like the way ncftp displays its screens and I can never get it to properly expect the end of the file transfer. What is the best approach or even software out there that can do this and exit cleanly. I need to attach the mirroring function to a website action form that is using PHP.
|
|
|
10-19-2005, 01:37 PM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
Check out "rsync". Its designed for keeping directories in sync between remote hosts.
|
|
|
10-19-2005, 01:47 PM
|
#3
|
Member
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207
Original Poster
Rep:
|
This was actually my first thought but doesn't the remote host have to be rsync enabled (acting as a server?) The only service I can use to the remote host is ftp. Can rsync function over FTP?
|
|
|
10-19-2005, 01:48 PM
|
#4
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Rep:
|
Re: Mirror an FTP site.
Quote:
Originally posted by unreal128
I need to mirror the file contents of an FTP site but the only access method is FTP (not SSH.) Currently I have an expect script that automates the download process via ncftp (which can copy whole directories automatically.) The script is rather dumb though since I have to manually terminate once all the files complete. Expect doesn't like the way ncftp displays its screens and I can never get it to properly expect the end of the file transfer. What is the best approach or even software out there that can do this and exit cleanly. I need to attach the mirroring function to a website action form that is using PHP.
|
Go for RSYNC.
I have my own tutorial on that. I have explained some easily understandable examples over there also.
GOTO : www.amitsharma.linuxbloggers.com
And if you got any problem in implementation of that, mail me or message me or revert to this thread.
Last edited by amitsharma_26; 08-06-2006 at 04:33 PM.
|
|
|
10-19-2005, 02:12 PM
|
#5
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Rep:
|
Quote:
Originally posted by unreal128
This was actually my first thought but doesn't the remote host have to be rsync enabled (acting as a server?) The only service I can use to the remote host is ftp. Can rsync function over FTP?
|
Dear i got a trick for you.
Switch off your FTP service at remote host.
In /etc/services at remote host comment out the line
#rsync 873/tcp
#rsync 873/udp.
Restart your box.
Then start rysnc at port 21 with command
rsync --port=21 --daemon
Now you are actually using port 21 i.e. FTP port for RSYNC.
On the remote side run rsync to access through port 21
rsync -avz --port=21 --progress -partial <username>@<remote-ip>::<share-name>/* /<local-location>
I TESTED THAT, IT WORKS.
For more detailed info regarding RSYNC goto www.amitsharma.linuxbloggers.com
FEEDBACK for any further query.
Last edited by amitsharma_26; 08-06-2006 at 04:34 PM.
|
|
|
10-19-2005, 02:46 PM
|
#6
|
Member
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207
Original Poster
Rep:
|
Unfortunately my only account access is as a limited rights FTP user. I am unable to edit the remote host's services. 
|
|
|
10-20-2005, 02:13 PM
|
#8
|
Member
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207
Original Poster
Rep:
|
This looks like a nice perl script for handling synchronization with FTP, thanks.
|
|
|
All times are GMT -5. The time now is 02:36 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|