DragonFly On-Line Manual Pages
ARCHIVE(8) InterNetNews Documentation ARCHIVE(8)
NAME
archive - Usenet article archiver
SYNOPSIS
archive [-cfr] [-a archive] [-i index] [-p pattern] [input]
DESCRIPTION
archive makes copies of files specified on its standard input. It is
normally run either as a channel feed under innd or by a script before
news.daily is run.
archive reads the named input file, or standard input if no file is
given. The input is taken as a sequence of lines; blank lines and
lines starting with a number sign ("#") are ignored. All other lines
should specify the token of an article to archive. Every article is
retrieved from a token, and the Xref: header is used to determine the
target file in the archive directory. You can limit the targets taken
from the Xref: header with the -p option.
Files are copied to a directory within the archive directory,
patharchive in inn.conf (or some other directory given with -a). The
default is to create a hierarchy that mimics a traditional news spool
storage of the given articles; intermediate directories will be created
as needed. For example, if the input token represents article 2211 in
the newsgroup comp.sources.unix, archive will by default store the
article as:
comp/sources/unix/2211
in the archive area. This can be modified with the -c and -f options.
OPTIONS
-a archive
If the -a flag is given, its argument specifies the root of the
archive area, instead of patharchive in inn.conf.
-c If the -c flag is given, directory names will be flattened as
described under the -f option. Then, additionally, all posts will
be concatenated into a single file, appending to that file if it
already exists. The file name will be "YYYYMM", formed from the
current time when archive is run. In other words, if given an
article in comp.sources.unix on December 14th, 1998, the article
would be appended to the file:
comp.sources.unix/199812
in the archive area.
Articles will be separated by a line containing only "-----------".
-f If the -f flag is used, directory names will be flattened,
replacing the slashes with the periods. In other words, article
2211 in comp.sources.unix will be written to:
comp.sources.unix/2211
in the archive area.
-i index
If the -i flag is used, archive will append one line to the file
index for each article that it archives. This line will contain
the destination file name, the Message-ID: header, and the Subject:
header of the message, separated by spaces. If either header is
missing (normally not possible if the article was accepted by
innd), it will be replaced by "<none>". The headers will be
transformed using the same rules as are used to generate overview
data (unfolded and then with tabs, CR, and LF replaced by spaces).
-p pattern
Limits the targets taken from the Xref: header to the groups
specified in pattern. pattern is a uwildmat(3) pattern matching
newsgroups that you wish to have archive handle.
-r By default, archive sets its standard error to pathlog/errlog. To
suppress this redirection, use the -r flag.
RETURN VALUE
If the input is exhausted, archive will exit with a zero status. If an
I/O error occurs, it will try to spool its input, copying it to a file.
If there was no input filename, the standard input will be copied to
pathoutgoing/archive and the program will exit. If an input filename
was given, a temporary file named input.bch (if input is an absolute
pathname) or pathoutgoing/input.bch (if the filename does not begin
with a slash) is created. Once the input is copied, archive will try
to rename this temporary file to be the name of the input file, and
then exit.
EXAMPLES
A typical newsfeeds(5) entry to archive most source newsgroups is as
follows:
source-archive!\
:!*,*sources*,!*wanted*,!*.d\
:Tc,Wn\
:<pathbin>/archive -f -i <patharchive>/INDEX
Replace <pathbin> and <patharchive> with the appropriate paths.
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Converted
to POD by Russ Allbery <eagle@eyrie.org>.
$Id: archive.pod 9767 2014-12-07 21:13:43Z iulius $
SEE ALSO
inn.conf(5), newsfeeds(5).
INN 2.6.0 2015-09-12 ARCHIVE(8)
ARCHIVE_UTIL(3) DragonFly Library Functions Manual ARCHIVE_UTIL(3)
NAME
archive_clear_error, archive_compression, archive_compression_name,
archive_copy_error, archive_errno, archive_error_string,
archive_file_count, archive_filter_code, archive_filter_count,
archive_filter_name, archive_format, archive_format_name,
archive_position, archive_set_error - libarchive utility functions
LIBRARY
Streaming Archive Library (libarchive, -larchive)
SYNOPSIS
#include <archive.h>
void
archive_clear_error(struct archive *);
int
archive_compression(struct archive *);
const char *
archive_compression_name(struct archive *);
void
archive_copy_error(struct archive *, struct archive *);
int
archive_errno(struct archive *);
const char *
archive_error_string(struct archive *);
int
archive_file_count(struct archive *);
int
archive_filter_code(struct archive *, int);
int
archive_filter_count(struct archive *, int);
const char *
archive_filter_name(struct archive *, int);
int
archive_format(struct archive *);
const char *
archive_format_name(struct archive *);
int64_t
archive_position(struct archive *, int);
void
archive_set_error(struct archive *, int error_code, const char *fmt,
...);
DESCRIPTION
These functions provide access to various information about the struct
archive object used in the libarchive(3) library.
archive_clear_error()
Clears any error information left over from a previous call. Not
generally used in client code.
archive_compression()
Synonym for archive_filter_code(a, 0).
archive_compression_name()
Synonym for archive_filter_name(a, 0).
archive_copy_error()
Copies error information from one archive to another.
archive_errno()
Returns a numeric error code (see errno(2)) indicating the reason
for the most recent error return. Note that this can not be
reliably used to detect whether an error has occurred. It should
be used only after another libarchive function has returned an
error status.
archive_error_string()
Returns a textual error message suitable for display. The error
message here is usually more specific than that obtained from
passing the result of archive_errno() to strerror(3).
archive_file_count()
Returns a count of the number of files processed by this archive
object. The count is incremented by calls to
archive_write_header(3) or archive_read_next_header(3).
archive_filter_code()
Returns a numeric code identifying the indicated filter. See
archive_filter_count() for details of the numbering.
archive_filter_count()
Returns the number of filters in the current pipeline. For read
archive handles, these filters are added automatically by the
automatic format detection. For write archive handles, these
filters are added by calls to the various
archive_write_add_filter_XXX() functions. Filters in the
resulting pipeline are numbered so that filter 0 is the filter
closest to the format handler. As a convenience, functions that
expect a filter number will accept -1 as a synonym for the
highest-numbered filter.
For example, when reading a uuencoded gzipped tar archive, there
are three filters: filter 0 is the gunzip filter, filter 1 is the
uudecode filter, and filter 2 is the pseudo-filter that wraps the
archive read functions. In this case, requesting
archive_position(a, -1) would be a synonym for
archive_position(a, 2) which would return the number of bytes
currently read from the archive, while archive_position(a, 1)
would return the number of bytes after uudecoding, and
archive_position(a, 0) would return the number of bytes after
decompression.
archive_filter_name()
Returns a textual name identifying the indicated filter. See
archive_filter_count() for details of the numbering.
archive_format()
Returns a numeric code indicating the format of the current
archive entry. This value is set by a successful call to
archive_read_next_header(). Note that it is common for this
value to change from entry to entry. For example, a tar archive
might have several entries that utilize GNU tar extensions and
several entries that do not. These entries will have different
format codes.
archive_format_name()
A textual description of the format of the current entry.
archive_position()
Returns the number of bytes read from or written to the indicated
filter. In particular, archive_position(a, 0) returns the number
of bytes read or written by the format handler, while
archive_position(a, -1) returns the number of bytes read or
written to the archive. See archive_filter_count() for details
of the numbering here.
archive_set_error()
Sets the numeric error code and error description that will be
returned by archive_errno() and archive_error_string(). This
function should be used within I/O callbacks to set system-
specific error codes and error descriptions. This function
accepts a printf-like format string and arguments. However, you
should be careful to use only the following printf format
specifiers: "%c", "%d", "%jd", "%jo", "%ju", "%jx", "%ld", "%lo",
"%lu", "%lx", "%o", "%u", "%s", "%x", "%%". Field-width
specifiers and other printf features are not uniformly supported
and should not be used.
SEE ALSO
archive_read(3), archive_write(3), libarchive(3), printf(3)
HISTORY
The libarchive library first appeared in FreeBSD 5.3.
AUTHORS
The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
DragonFly 5.9-DEVELOPMENT February 2, 2012 DragonFly 5.9-DEVELOPMENT