DragonFly On-Line Manual Pages

Search: Section:  


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_ENTRY_STAT(3) DragonFly Library Functions Manual ARCHIVE_ENTRY_STAT(3)

NAME

archive_entry_stat, archive_entry_copy_stat, archive_entry_filetype, archive_entry_set_filetype, archive_entry_mode, archive_entry_set_mode, archive_entry_size, archive_entry_size_is_set, archive_entry_set_size, archive_entry_unset_size, archive_entry_dev, archive_entry_set_dev, archive_entry_dev_is_set, archive_entry_devmajor, archive_entry_set_devmajor, archive_entry_devminor, archive_entry_set_devminor, archive_entry_ino, archive_entry_set_ino, archive_entry_ino_is_set, archive_entry_ino64, archive_entry_set_ino64, archive_entry_nlink, archive_entry_rdev, archive_entry_set_rdev, archive_entry_rdevmajor, archive_entry_set_rdevmajor, archive_entry_rdevminor, archive_entry_set_rdevminor -- accessor functions for manipulating archive entry descriptions

LIBRARY

Streaming Archive Library (libarchive, -larchive)

SYNOPSIS

#include <archive_entry.h> const struct stat * archive_entry_stat(struct archive_entry *a); void archive_entry_copy_stat(struct archive_entry *a, const struct stat *sb); mode_t archive_entry_filetype(struct archive_entry *a); void archive_entry_set_filetype(struct archive_entry *a, unsigned int type); mode_t archive_entry_mode(struct archive_entry *a); void archive_entry_set_mode(struct archive_entry *a, mode_t mode); int64_t archive_entry_size(struct archive_entry *a); int archive_entry_size_is_set(struct archive_entry *a); void archive_entry_set_size(struct archive_entry *a, int64_t size); void archive_entry_unset_size(struct archive_entry *a); dev_t archive_entry_dev(struct archive_entry *a); void archive_entry_set_dev(struct archive_entry *a, dev_t dev); int archive_entry_dev_is_set(struct archive_entry *a); dev_t archive_entry_devmajor(struct archive_entry *a); void archive_entry_set_devmajor(struct archive_entry *a, dev_t major); dev_t archive_entry_devminor(struct archive_entry *a); void archive_entry_set_devminor(struct archive_entry *a, dev_t minor); ino_t archive_entry_ino(struct archive_entry *a); void archive_entry_set_ino(struct archive_entry *a, unsigned long ino); int archive_entry_ino_is_set(struct archive_entry *a); int64_t archive_entry_ino64(struct archive_entry *a); void archive_entry_set_ino64(struct archive_entry *a, int64_t ino); unsigned int archive_entry_nlink(struct archive_entry *a); void archive_entry_set_nlink(struct archive_entry *a, unsigned int count); dev_t archive_entry_rdev(struct archive_entry *a); dev_t archive_entry_rdevmajor(struct archive_entry *a); dev_t archive_entry_rdevminor(struct archive_entry *a); void archive_entry_set_rdev(struct archive_entry *a, dev_t dev); void archive_entry_set_rdevmajor(struct archive_entry *a, dev_t major); void archive_entry_set_rdevminor(struct archive_entry *a, dev_t minor);

DESCRIPTION

Copying to and from struct stat The function archive_entry_stat() converts the various fields stored in the archive entry to the format used by stat(2). The return value remains valid until either archive_entry_clear() or archive_entry_free() is called. It is not affected by calls to the set accessor functions. It currently sets the following values in struct stat: st_atime, st_ctime, st_dev, st_gid, st_ino, st_mode, st_mtime, st_nlink, st_rdev, st_size, st_uid. In addition, st_birthtime and high-precision information for time-related fields will be included on platforms that support it. The function archive_entry_copy_stat() copies fields from the platform's struct stat. Fields not provided by struct stat are unchanged. General accessor functions The functions archive_entry_filetype() and archive_entry_set_filetype() get respectively set the filetype. The file type is one of the following constants: AE_IFREG Regular file AE_IFLNK Symbolic link AE_IFSOCK Socket AE_IFCHR Character device AE_IFBLK Block device AE_IFDIR Directory AE_IFIFO Named pipe (fifo) Not all file types are supported by all platforms. The constants used by stat(2) may have different numeric values from the corresponding constants above. The functions archive_entry_mode() and archive_entry_set_mode() get/set a combination of file type and permissions and provide the equivalent of st_mode. Use of archive_entry_filetype() and archive_entry_perm() for getting and archive_entry_set_filetype() and archive_entry_set_perm() for setting is recommended. The function archive_entry_size() returns the file size, if it has been set, and 0 otherwise. archive_entry_size() can be used to query that status. archive_entry_set_size() and archive_entry_unset_size() set and unset the size, respectively. The number of references (hardlinks) can be obtained by calling archive_entry_nlinks() and set with archive_entry_set_nlinks(). Identifying unique files The functions archive_entry_dev() and archive_entry_ino64() are used by archive_entry_linkify(3) to find hardlinks. The pair of device and inode is supposed to identify hardlinked files. The device major and minor number can be obtained independently using archive_entry_devmajor() and archive_entry_devminor(). The device can be set either via archive_entry_set_dev() or by the combination of major and minor number using archive_entry_set_devmajor() and archive_entry_set_devminor(). The inode number can be obtained using archive_entry_ino(). This is a legacy interface that uses the platform ino_t, which may be very small. To set the inode number, archive_entry_set_ino64() is the preferred interface. Accessor functions for block and character devices Block and character devices are characterised either using a device number or a pair of major and minor number. The combined device number can be obtained with archive_device_rdev() and set with archive_device_set_rdev(). The major and minor numbers are accessed by archive_device_rdevmajor(), archive_device_rdevminor() archive_device_set_rdevmajor() and archive_device_set_rdevminor(). The process of splitting the combined device number into major and minor number and the reverse process of combing them differs between platforms. Some archive formats use the combined form, while other formats use the split form.

SEE ALSO

archive_entry_acl(3), archive_entry_perms(3), archive_entry_time(3), libarchive(3), stat(2) DragonFly 4.5 February 2, 2012 DragonFly 4.5

Search: Section: