1

Хотел настроить синхронизацию двух папок удаленых машин. fedora 17. Но не как не получается.
Есть две машины f17.9 и f17.10.

На f17.10 настроин rsync сервер. Вот его конфиг:

[share]
 comment = share
 path = /home/samba
 use chroot = true
 uid = root
 gid = root
 log file = /var/log/rsyncd/logs.log
 read only = false
 write only = false
 hosts allow = f17.9 f17.10
 hosts deny = *
 transfer logging = false

f17.9 lsyncd конфиг выглядит так.

settings = {
  logfile    = "/var/log/lsyncd/lsyncd.log",
  statusFile = "/var/log/lsyncd/lsyncd.status",
  nodaemon   = true 
}

sync {
  default.rsync, 
  source="/home/samba", 
  target="f17.10://share/",
  rsyncOps={"-ausS"},
  delay=1 
}

но при запуске спрашивает пароль ssh зачем то и все равно папки не синхронизируются вообще не как. Пишется только вот что.

[root@f17 lsyncd]# lsyncd lsyncd.conf.lua
01:12:29 Normal: recursive startup rsync: /home/samba/ -> share/
01:12:29 Normal: Startup of '/home/samba/' finished.
01:12:34 Normal: Calling rsync with filter-list of new/modified files/dirs
/clear22222222
/
01:12:34 Normal: Finished a list = 0
^C
[root@f17 lsyncd]# vim lsyncd.conf.lua 
[root@f17 lsyncd]# lsyncd lsyncd.conf.lua
01:17:48 Normal: recursive startup rsync: /home/samba/ -> f17.10://share/
root@f17.10's password: 
01:18:26 Normal: Startup of '/home/samba/' finished.
01:18:37 Normal: Calling rsync with filter-list of new/modified files/dirs
/testfile
/
root@f17.10's password:
01:18:43 Normal: Finished a list = 0 

если ввести sync -ausS /home/samba/ rsync://f17.10/share то все файлы синхронизируются. Помогите пожалуйста разобраться.

2

подправил конфиг

settings = {
  logfile    = "/var/log/lsyncd/lsyncd.log", 
  statusFile = "/var/log/lsyncd/lsyncd.status", 
  nodaemon   = true 
} 

sync { 
  default.rsync, 
  source="/home/samba/",
  target="rsync@f17.10-rsync::share/",
  rsyncOps={"-ausS"},
  delay=10 

}


после запуска выдает

[root@f17 lsyncd]# lsyncd -log all lsyncd.conf.lua 
kernels clocks_per_sec=100
Call: configure()
Inotify: inotify fd = 3
Call: initialize()
03:33:37 Function: Inotify.addWatch(/home/samba/, (true), (nil), (nil))
03:33:37 Inotify: addwatch(/home/samba/)->1
03:33:37 Normal: recursive startup rsync: /home/samba/ -> rsync@f17.10-rsync::share/
03:33:37 Exec: /usr/bin/rsync [--delete] [-ausS] [-r] [/home/samba/] [rsync@f17.10-rsync::share/]
03:33:37 Call: getAlarm()
03:33:37 Debug: getAlarm returns: (false)
03:33:37 Masterloop: going into select (no timeout).
rsync: getaddrinfo: f17.10-rsync 873: Name or service not known
rsync error: error in socket IO (code 10) at clientserver.c(122) [sender=3.0.9]
03:33:37 Call: collectProcess()
03:33:37 Delay: collected an event
03:33:37 Normal: Retrying startup of '/home/samba/'.
03:33:37 Call: cycle()
03:33:37 Function: invokeActions('Sync1',(Timestamp: 4312878.68))
03:33:37 Function: write((Timestamp: 4312878.68))
03:33:37 Statusfile: writing now
03:33:37 Call: getAlarm()
03:33:37 Debug: getAlarm returns: (Timestamp: 4312888.68)
03:33:37 Masterloop: going into select (timeout 9.99 seconds)
03:33:43 Call: inotifyEvent()
03:33:43 Inotify: got event Create 1231234145111(1)
03:33:43 Function: delay(Sync1, Create, /1231234145111, (nil))
03:33:43 Delay: Create:/1231234145111blocked byBlanket event
03:33:43 Call: cycle()
03:33:43 Function: invokeActions('Sync1',(Timestamp: 4312883.95))
03:33:43 Function: write((Timestamp: 4312883.95))
03:33:43 Statusfile: setting alarm: (Timestamp: 4312893.95)
03:33:43 Call: getAlarm()
03:33:43 Debug: getAlarm returns: (Timestamp: 4312888.68)
03:33:43 Masterloop: going into select (timeout 4.73 seconds)
03:33:43 Call: inotifyEvent()
03:33:43 Inotify: got event Modify 1231234145111(1)
03:33:43 Function: delay(Sync1, Modify, /1231234145111, (nil))
03:33:43 Delay: Modify:/1231234145111 absorbed by Create:/1231234145111
03:33:43 Call: cycle()
03:33:43 Function: invokeActions('Sync1',(Timestamp: 4312883.96))
03:33:43 Function: write((Timestamp: 4312883.96))
03:33:43 Statusfile: waiting((Timestamp: 4312883.96) < (Timestamp: 4312893.95))
03:33:43 Call: getAlarm()
03:33:43 Debug: getAlarm returns: (Timestamp: 4312888.68)
03:33:43 Masterloop: going into select (timeout 4.72 seconds)
03:33:47 Call: cycle()
03:33:47 Function: invokeActions('Sync1',(Timestamp: 4312888.68))
03:33:47 Normal: Calling rsync with filter-list of new/modified files/dirs

03:33:47 Exec: /usr/bin/rsync [<] [] [-ausS] [-r] [--delete] [--force] [--from0] [--include-from=-] [--exclude=*] [/home/samba/] [rsync@f17.10-rsync::share/]
03:33:47 Function: write((Timestamp: 4312888.68))
03:33:47 Statusfile: waiting((Timestamp: 4312888.68) < (Timestamp: 4312893.95))
03:33:47 Call: getAlarm()
03:33:47 Debug: getAlarm returns: (Timestamp: 4312893.95)
03:33:47 Masterloop: going into select (timeout 5.27 seconds)
03:33:53 Call: cycle()
03:33:53 Function: invokeActions('Sync1',(Timestamp: 4312893.96))
03:33:53 Function: write((Timestamp: 4312893.96))
03:33:53 Statusfile: writing now
03:33:53 Call: getAlarm()
03:33:53 Debug: getAlarm returns: (false)
03:33:53 Masterloop: going into select (no timeout).

как быть подскажите пожалуйста

3 (13.08.2012 22:18:23 отредактировано semperN)

можно закрывать тему. Перелопатил конфиг оказался вот как надо было делать.

settings = {
  logfile    = "/var/log/lsyncd/lsyncd.log", 
  statusFile = "/var/log/lsyncd/lsyncd.status", 
  nodaemon   = "true", 
} 

sync { 
  default.rsync,
  source="/home/samba/",
  target="rsync@f17.10::share/",
  rsyncOps={"-ausS"},
  delay=10,
}

странно почему только в мануале не написано про синтаксис target="rsync@f17.10::share/", не чего такого.