destination files not being deleted

407 weergaven
Naar het eerste ongelezen bericht

dp...@realtruck.com

ongelezen,
12 mei 2016, 17:53:2012-05-2016
aan lsyncd
I have successfully gotten lsyncd to work between two Debian Jessie servers.  Everything works great with 1 single exception.

My expectation that is confirmed by documentation is that if the file doesn't exist on the destination, it will be deleted.  What is happening is that the only time files that exist on the destination and not in the source are deleted is if I restart the lsyncd service.  Is that an expected behavior, or am I missing something?

This is my configuration file:
root@nginx1:/etc# cat /etc/lsyncd/lsyncd.conf
----
--
settings = {
  logfile = "/var/log/lsyncd/lsyncd.log",
  statusFile = "/var/log/lsyncd/lsyncd.stat",
  statusInterval = 2,
}

-- nginx2
sync{
  default.rsync,
  source="/binarydata/",
  target="192.168.2.41:/binarydata/",
  rsync={
    compress = true,
    acls = true,
    verbose = true,
    owner = true,
    group = true,
    perms = true,
    rsh ="/usr/bin/ssh -l root -i /root/.ssh/id_rsa",
    _extra = { "--delete" }
  }
}root@nginx1:/etc#


And my server:

root@nginx1
:/etc# cat os-release
PRETTY_NAME="Debian GNU/
Linux 8 (jessie)"
NAME="
Debian GNU/Linux"
VERSION_ID="
8"
VERSION="
8 (jessie)"
ID=debian
HOME_URL="
http://www.debian.org/"
SUPPORT_URL
="http://www.debian.org/support"
BUG_REPORT_URL
="https://bugs.debian.org/"
root@nginx1
:/etc# uname -a
Linux nginx1 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/
Linux
root@nginx1
:/etc# dpkg -l | grep lsync
ii lsyncd 2.1.5-2 amd64 daemon to synchronize local directories using rsync
root@nginx1:/
etc#

Any suggestions?

Axel Kittenberger

ongelezen,
13 mei 2016, 09:24:3613-05-2016
aan lsyncd
"My expectation that is confirmed by documentation is that if the file doesn't exist on the destination, it will be deleted"

I don't get what this means, if it doesn't exist on the destination, there is nothing to delete.

--
You received this message because you are subscribed to the Google Groups "lsyncd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lsyncd+un...@googlegroups.com.
To post to this group, send email to lsy...@googlegroups.com.
Visit this group at https://groups.google.com/group/lsyncd.
For more options, visit https://groups.google.com/d/optout.

dp...@realtruck.com

ongelezen,
13 mei 2016, 11:30:2613-05-2016
aan lsyncd
my apologies.  If it exists on the destination and not on source, it should be deleted.  This is not happening.

Axel Kittenberger

ongelezen,
13 mei 2016, 11:53:2413-05-2016
aan lsyncd
First I would remove the     _extra = { "--delete" } line and see what happens, _extra is a dirty workaround that shouldn't be used unless absolutely necessary.
Especially there is no reason to add --delete, since Lsyncd will do that by itself when its necessary

On Fri, May 13, 2016 at 5:30 PM, dpich via lsyncd <lsy...@googlegroups.com> wrote:
my apologies.  If it exists on the destination and not on source, it should be deleted.  This is not happening.

--

dp...@realtruck.com

ongelezen,
13 mei 2016, 15:03:1113-05-2016
aan lsyncd
Alright...

Here is my config now:
----
--
settings = {
  logfile = "/var/log/lsyncd/lsyncd.log",
  statusFile = "/var/log/lsyncd/lsyncd.stat",
  statusInterval = 2,
}

-- nginx2
sync{
  default.rsync,
  source="/binarydata/",
  target="192.168.2.41:/binarydata/",
  rsync={
    compress = true,
    acls = true,
    verbose = true,
    owner = true,
    group = true,
    perms = true,
    rsh ="/usr/bin/ssh -l root -i /root/.ssh/id_rsa",
  }
}

So the results are still happening.  The only way I can get the destination file that should be deleted to actually be deleted is by restarting lsyncd.


Every 1.0s: ls -hal /binarydata/                                     Thu May 12 17:04:37 2016


total
4.0K
drwxr
-xr-x  2 root root   21 May 12 17:01 .
drwxr
-xr-x 23 root root 4.0K May 12 12:39 ..
-rw-r--r--  1 root root    0 May 12 17:00 file.txt

In the lsyncd logs after restart:
==> lsyncd.log <==
Thu May 12 17:08:33 2016 Normal: --- TERM signal, fading ---
Thu May 12 17:08:33 2016 Normal: recursive startup rsync: /binarydata/ -> 192.168.2.41:/binarydata/
tail: lsyncd.stat: file truncated
Lsyncd status report at Thu May 12 17:08:33 2016

Sync1 source=/binarydata/
There are 1 delays
active Init
Excluding:
  nothing.


Inotify watching 1 directories
  1: /binarydata/

==> lsyncd.log <==
sending incremental file list
deleting file.txt

sent 48 bytes  received 24 bytes  144.00 bytes/sec
total size is 0  speedup is 0.00
Thu May 12 17:08:33 2016 Normal: Startup of "/binarydata/" finished.
tail: lsyncd.stat: file truncated



Sakshi Sood

ongelezen,
19 mei 2017, 05:54:1219-05-2017
aan lsyncd

I am also facing the same issue ...Have you found any solution yet ?
Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten