[Csync2] Logfile Issues

Lars Ellenberg lars.ellenberg at linbit.com
Mon Sep 28 17:11:20 CEST 2015


On Sat, Sep 26, 2015 at 09:28:16PM -0400, Brian Blater wrote:
> I've got csync2 installed on a couple of Ubuntu servers that together with
> watcher.py will be keeping a large file system synchronized. All the
> files/directories are under the path /data/ and there is about 5
> directories there, but under those directories could be hundreds if not
> thousands of other files and directories.
> 
> I'm basically getting everything setup right now and doing some tests. The
> sync part works great together with watcher.py to maintain an almost
> realtime update.
> 
> The problem I'm having is getting logging setup and working for csync2.
> From what I can gather I have to setup an action under the group for the
> logging. This is what I have in the csync2.cfg:
> 
> nossl * *;
> 
> group production {
>         key /etc/csync-production-group.key;
>         host server1;
>         host server2;
>         include /data;
>         exclude /data/conflict;
>         exclude *~ .*;
>         action {
>                 pattern /data/*;
>                 logfile "/var/log/csync2/csync2.log";

That would log the output of the *action*
(but you did not define any).

action being some command to be called
if csync2 updated a file matching pattern.

intended use case would be a pattern matching some apache conf files,
and an action that basically does "apachectl graceful", once that
conf file has been copied over.

>                 do-local;
>         }
>         auto none;
> }
> 
> I'm not getting any logging at all. I can't figure out if the pattern is
> wrong or what. I basically want csync2 to log what it does in the log file,
> but I can't get it working.
> 
> Any help would be greatly appreciated.

If you want csync2 to log what it does,
you have to increase its "verbosity" (add -v...),
and possibly tell it to use syslog.
it usually should redirect to syslog anyways,
if it detects that it has no tty.


-- 
: Lars Ellenberg
: http://www.LINBIT.com | Your Way to High Availability
: DRBD, Linux-HA  and  Pacemaker support and consulting

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.


More information about the Csync2 mailing list