On Thu, 2 Jun 2005 11:06:07 +0300, "Mr.Jason"
<jaakkochanREMOVETHIS@surfeu.fi> wrote:
> What kind of script I sould write to another linux maching so that it would
> peridiocally download certain file via FTP from my server?
FTP is an old protocol with plaintext username/password. Take the
time to learn rsync, a cron triggered rsync is best way, also
(can't find reference) there's a reference out there for time
based rsync backups exploiting unix hardlinked filesystem, learn
rsync first.
Take care with --delete option, don't use it until you sure rsync
working as expected.
Here's one that copies a subset of slackware install files to firewall:
grant@deltree:/home/local$ cat rsync-slack
#!/bin/sh
rsync -avP --delete --delete-excluded \
--exclude extra \
--exclude pasture \
--exclude source \
--exclude testing \
--exclude zipslack \
--exclude slackware/d \
--exclude slackware/e \
--exclude slackware/f \
--exclude slackware/gnome \
--exclude slackware/k \
--exclude slackware/kde \
--exclude slackware/kdei \
--exclude slackware/t \
--exclude slackware/tcl \
--exclude slackware/x \
--exclude slackware/xap \
peetoo.mire.mine.nu::slackware-10.1/ \
/home/local/slack-10.1
peetoo is fileserver box, but it could be a machine anywhere on
the 'net. Scripts I use to rsync external stuff similar syntax.
from man rsync:
Some of the additional features of rsync are:
o support for copying links, devices, owners, groups, and
permissions
o exclude and exclude-from options similar to GNU tar
o a CVS exclude mode for ignoring the same files that CVS
would ignore
o can use any transparent remote shell, including ssh or rsh
o does not require root privileges
o pipelining of file transfers to minimize latency costs
o support for anonymous or authenticated rsync servers
(ideal for mirrorĀ*
ing)
On the server you need to describe rsync sources in a manner similar
to samba, rsync written by samba author.
grant@peetoo:/home/public$ cat /etc/rsyncd.conf
# /etc/rsyncd.conf for slackware-10.1 on peetoo
uid = nobody
gid = nobody
use chroot = no
max connections = 4
syslog facility = local5
pid file = /var/run/rsyncd.pid
[install]
path = /home/install
comment = peetoo install area (ro)
read only = yes
[slackware-10.1]
path = /home/install/slackware-10.1
comment = install slackware-10.1 (ro)
read only = yes
[slackware-current]
path = /home/install/slackware-current
comment = slackware-current (ro)
read only = yes
[public]
path = /home/public
comment = peetoo public area (ro)
read only = yes
Of course my firewall prevents external access to rsync server.
Notice the read-only? Protect yourself against finger trouble
while learning
Apologies for word-wrapping or strangeness, trying the other news
server, settings on UA not quite right yet.
--Grant.