|
NAMEactsync, actsyncd - Synchronize newsgroupsSYNOPSISactsync [-AkmT] [-b hostid] [-d hostid] [-g max] [-i ignore-file] [-I hostid] [-l hostid] [-n name] [-o format] [-p min-unchanged] [-q hostid] [-s size] [-t hostid] [-v verbosity] [-w seconds] [-z seconds] [host] hostactsyncd config [debug-level [debug-format]] IN A NUTSHELLThese programs permit keeping the list of newsgroups your news server carry synchronized with an external source.For instance, you can decide to carry the same newsgroups as another news server or as the ones listed in a file from an external FTP site, and therefore synchronizing with the chosen source on a daily basis by running actsyncd in a cron job. If you only want a subset of newsgroups from that source, it can be parametered in the actsync.ign configuration file in the pathetc directory. INN comes with a default configuration for fetching the list of newsgroups from "ftp.isc.org". You can read about the policies used for maintaining that active file at <https://ftp.isc.org/pub/usenet/CONFIG/README>. Just make sure actsync.cfg (the configuration file) and actsync.ign (the synchronization rules) suit your needs, and run: actsyncd <pathetc>/actsync.cfg You'll find more detailed examples of use below in this man page. DESCRIPTIONactsync permits one to synchronize, compare, or merge two active files. With this utility one may add, change, or remove newsgroups on the local news server to make it similar to the list of the newsgroups found on another system or file. The synchronization need not be exact. Local differences in newsgroup lists may be maintained and preserved. Certain newsgroup errors may be detected and optionally corrected.There are several reasons to run actsync (or actsyncd) on a periodic basis. Among the reasons are:
If either host argument begins with "." or "/", it is assumed to be the name of a file containing information in the active(5) format. The getlist(1) utility may be used to obtain a copy of a remote system's active file via its NNTP server, or an FTP client program can retrieve such a file from an FTP archive (such as ftp.isc.org available in both FTP and HTTPS <https://ftp.isc.org/pub/usenet/CONFIG/active>; see more about this below). Newsgroup information from a file may be treated as if it was obtained from a host. In this man page, the host arguments on the command line are called hosts, even though they may be file names. If a host argument does not begin with "." or "/", it is assumed to be a hostname or Internet address. In this case, actsync will attempt to use the NNTP protocol to obtain a copy of the specified system's active file. If the host argument contains ":", the right side will be considered the port to connect to on the remote system. If no port number is specified, actsync will connect to port 119. Regardless how the active file information is obtained, the actions of actsync remain the same. The first host specified is taken to be the local host, the one where any changes would be made. The second host specified is the remote host that is being synchronized with. If only one host is specified, it is assumed to be the remote host to synchronize with, and the local host is assumed to be the default local NNTP server as specified by the NNTPSERVER environment variable or by the server value found in inn.conf. If either host is specified as "-", the default server will be used for that host, determined as described above. The newsgroup synchronization, by default, involves all newsgroups found on both hosts. One may also synchronize a subset of newsgroups by directing actsync to ignore certain newsgroups from both systems. Only newsgroups with valid names will be synchronized. To be valid, a newsgroup name must consist only of alphanumeric characters, ".", "+", "-", and "_". One may not have two "." characters in a row. The first character must be alphanumeric, as must any character following ".". The name may not end in a "." character. The actsyncd daemon provides a convenient interface to configure and run actsync. If a host is not initially reachable, the daemon will retry up to 9 additional times, waiting 6 minutes before each retry. This daemon runs in the foreground, sending output to standard output and standard error. It then uses mod-active(8) to update the active file if there are commands for ctlinnd in its output. The configuration filename for the daemon is given as a command line argument, usually actsync.cfg in pathetc. The config file can contain the following options: host=<host> ftppath=<path-to-active> ignore_file=<ignore-file> flags=<actsync-options> The "host=", "ignore_file=", and "flags=" lines are mandatory. Each keyword must start at the beginning of the line, and there may be no whitespace before the "=" character. Blank lines are ignored, as are comment lines that start with "#". Any other lines may produce undefined results. The <host> setting refers to the second (remote) host parameter to actsync. If <path-to-active> is provided, <host> is accessed as an FTP server, retrieving the file named. If the filename ends in ".gz" or ".Z", it will be automatically uncompressed after retrieval. <ignore-file> names the ignore file used by actsync (the -i option). <actsync-options> contains any other flags that you wish to pass to actsync. Note that one should not include -i or -o options in the "flags=" line; they are automatically taken care of by actsyncd. One may produce a trial actsyncd run without changing anything on the server by supplying the debug-level argument: actsyncd <pathetc>/actsync.cfg 2 The debug-level causes actsyncd to run actsync with a -v debug-level flag (overriding any -v flag on the "flags=" line), not make any changes to the active file, write a new active file to standard output, and write debug messages to standard error. Note that using debug-level is only supported when synchronizing with another news server, not with FTP. If the debug-format argument is also given to actsyncd, the data written to standard output will be in -o debug-format instead of in "-o a1" format. INN comes with default values of "ftp.isc.org" for <host> and "/pub/usenet/CONFIG/active.gz" for <path-to-active>. You can read about the policies used for maintaining that active file at <https://ftp.isc.org/pub/usenet/CONFIG/README>. Consider synchronizing from this file on a daily basis by using a cron job. OPTIONSactsync takes the following options.In all of the following options, the hostid parameter takes one of the following values: 0 neither server 1 local default server 2 remote server 12 both servers 21 both servers In other words, 1 refers to the local host (the first host argument on the actsync command line) and 2 refers to the remote host (the second host argument, or the only one if only one is given).
However, a newsgroup that is equivalent to an ignored newsgroup is not a problem. The default is "-l 12": problem newsgroups from both hosts are marked as errors.
The "a", "a1", "ak", "aK", "a1k", "a1K", "ak1", and "aK1" style formats allow one to format new active file instead of producing ctlinnd commands. They use high and low values of 0000000000 and 0000000001 respectively for newsgroups that are created unless otherwise specified. The "ak" and "aK" variants change the high and low values (2nd and 3rd active fields). In the case of "ak", newsgroups created take their high and low values from the remote host. In the case of "aK", all newsgroups found on the remote host take their high and low values from it. The "c" format produces ctlinnd commands. No actions are taken because actsync simply prints ctlinnd commands on standard output. This output format is useful to let you see how the local host will be affected by the sync (or merge) with the remote host. The sync (or merge) may be accomplished directly by use of the "x" or "xi" format. With this format, actsync uses the execl(2) system call to directly execute ctlinnd commands. The output of such exec calls may be seen if the verbosity level is at least 2. The actsync utility will pause for 4 seconds before each command is executed if "-o x" is selected. See the -z flag below for discussion of this delay and how to customize it. The "xi" format interactively prompts on standard output and reads directives on standard input. One may pick and choose changes using this format. Care should be taken when producing active(5) formatted output. One should check to be sure that actsync exited with a zero status prior to using such output. Also one should realize that such output will not contain lines ignored due to -i even if "-p 100" is used. By default, "-o c" is assumed.
EXAMPLESDetermine the difference (but don't change anything) between your newsgroup set and the one of another news server:actsync news.server.com Same as above, with full debug and progress reports: actsync -v 4 news.server.com Force a site to have the same newsgroups as some other site: actsync -o x master This may be useful to sync a slave site to its master, or to sync internal site to a gateway. Compare your site with news.server.com, disregarding local groups and certain local differences with it. Produce a report if any differences were encountered: actsync -v 2 -i actsync.ign news.server.com where actsync.ign contains: # Don't compare to.* groups as they will differ. # i to.* # These are our local groups that nobody else # (should) carry. So ignore them for the sake # of the compare. # i nsa.* # These groups are local favorites, so keep them # even if news.server.com does not carry them. # i ca.dump.bob.dorman i ca.keep.bob.dorman i alt.tv.dinosaurs.barney.die.die.die i alt.tv.dinosaurs.barney.love.love.love i alt.sounds.* =alt.binaries.sounds.* To interactively sync against news.server.com, using the same ignore file: actsync -o xi -v 2 -i actsync.ign news.server.com Based on newsgroups that you decided to keep, one could make changes to the actsync.ign file: # Don't compare to.* groups as they will differ. # i to.* # These are our local groups that nobody else # (should) carry. So ignore them for the sake # of the compare. # i nsa.* # These groups are local favorites, so keep them # even if news.server.com does not carry them. # i ca.dump.bob.dorman i alt.tv.dinosaurs.barney.die.die.die i alt.sounds.* =alt.binaries.sounds.* # Don't sync test groups, except for ones that are # moderated or that are under the gnu hierarchy. # i *.test c *.test m # check moderated test groups c gnu.*.test c gnu.test # just in case it ever exists Automatic processing may be set up by using the following actsync.cfg file: # Host to sync off of (host2). host=news.server.com # Location of the ignore file. ignore_file=<pathetc in inn.conf>/actsync.ign # Where news articles are kept. spool=<patharticles in inn.conf> # actsync(8) flags # # Automatic execs, report if something was done, # otherwise don't say anything, don't report # news.server.com active file problems, just ignore # the affected entries. flags=-o x -v 2 -q 2 and then by running actsyncd with the path to the config file: actsyncd <pathetc>/actsync.cfg The command actsyncd <pathetc>/actsync.cfg 4 >cmd.log 2>dbg.log will operate in debug mode, not change the active file, write ctlinnd style commands to cmd.log, and write debug statements to dbg.log. (Note that using debug-level is only supported when synchronizing with another news server, not with FTP.) To check only the major hierarchies against news.server.com, use the following actsync.ign file: # By default, ignore everything. # i * # Check the major groups. # c alt.* c comp.* c gnu.* c humanities.* c misc.* c news.* c rec.* c sci.* c soc.* c talk.* and the command: actsync -i actsync.ign news.server.com To determine the differences between your old active and your current default server: actsync <pathetc>/active.old - To report but not fix any newsgroup problems with the current active file: actsync - - To detect any newsgroup errors on your local server, and to remove any *.bork.bork.bork-style silly newsgroup names: actsync -b 2 - - The active file produced by: actsync <flags> -o x erehwon.honey.edu is effectively the same as the active file produced by: cd <pathdb> ctlinnd pause 'running actsync' rm -f active.new actsync <flags> -o a1 erehwon.honey.edu > active.new rm -f active.old ln active active.old mv active.new active ctlinnd reload active 'running actsync' ctlinnd go 'running actsync' It should be noted that the final method above, pausing the server and simply replacing the active file, may be faster if you are making lots of changes. FILES
CAUTIONCareless use of this tool may result in the unintended addition, change, or removal of newsgroups. You should avoid using the "x" output format until you are sure it will do what you want.BUGSIf a newsgroup appears multiple times, actsync will treat all copies as errors. However, if the group is marked for removal, only one rmgroup will be issued.HISTORYWritten by Landon Curt Noll <chongo@toad.com> for InterNetNews. Updated to support FTP fetching by David Lawrence <tale@isc.org>. Converted to POD by Russ Allbery <eagle@eyrie.org>.By Landon Curt Noll <chongo@toad.com> (chongo was here /\../\). Copyright (c) Landon Curt Noll, 1993. All rights reserved. Permission to use and modify is hereby granted so long as this notice remains. Use at your own risk. No warranty is implied. SEE ALSOactive(5), ctlinnd(8), getlist(1), inn.conf(5), libinn_uwildmat(3), mod-active(8), passwd.nntp(5), simpleftp(1).
Visit the GSP FreeBSD Man Page Interface. |