The FreeBSD Diary |
![]() |
(TM) | Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link. |
|
Creating an FTP Mirror site
14 February 1999
|
| This article tells you how to set up an FTP mirror site. It will allow you to keep the files on one system up to date with the files on another system. It's very easy to do and pretty quick and painless. |
|
My failed attempt
|
| You are welcome to try this method. If you get it to work or you know how to
make it work, please add your comments.
At the moment, the successful attempt is what you
should try if you want it to work. My first attempt involved the mirror port. Please don't confuse this with the cvsup-mirror port. The latter is a "kit for easily setting up a FreeBSD mirror site using CVSup" and which is what I used to create my article on Setting up a FreeBSD mirror site. The mirror port is a separate tool which can be used for any type of mirroring. It sounds like a great tool. I just couldn't get it to work. I did the normal make install. And some configuration. But when it came time to the running, I couldn't enter PASV (passive) mode for my connection. I'm behind a firewall, so I needed PASV mode. Here is the output:
|
My successful attempt to set up an FTP involved using the rsync port.
This should be familiar to you now. Since I have all the
ports installed, all I needed to do was:[root@ns:~] # cd /usr/ports/net/rsync [root@ns:/usr/ports/net/rsync] # make [root@ns:/usr/ports/net/rsync] # make install |
|
Configuring the FTP server
|
My first attempt at mirroring using rsync failed. I ran out of disk
space. When people connect to an FTP server, the FTP daemon (ftpd) is given
a root directory. This is where ftpd will find all of its files. On
my machine, this was set to /var/ftp, which doesn't have much space. I
needed to change to another directory, so I ran vipw and changed the directory.
Here's what it looks like now:ftp:*:14:5::0:0:Anonymous FTP Admin:/pub/ftp:/nonexistent The bit I changed was /pub/ftp. Remember to create the subdirectory. Then I moved my files from the old location to the new location.
I then created the subdirectories (/pub/ftp/pub/FreeBSD/releases/) into which I was going to receive the mirror files. Then I was to run rsync. Here are some of the commands I use to maintain my mirror:
Here is the /etc/crontab entry I use to run the above every day (those are tabs, not spaces): 0 3 * * * root /usr/local/etc/rsync/update.sh And here is the rsync shell script which the above will run. I stole this from my cvsup-mirror. |